C程序怎么解决超出输出极限

[复制链接]
查看11 | 回复1 | 2011-8-5 14:27:26 | 显示全部楼层 |阅读模式
题目:
Problem Description
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".
Input
each test case contains two numbers A and B.
Output
for each case, if A is equal to B, you should print "YES", or print "NO".
Sample Input
1 2
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
我的代码:(有点简单)提示我“超出输出极限”
#include
int main()
{

float n,m;

while(scanf("%f %f",&n,&m)!=EOF)

{

if(m==n)

printf("YES\n");

else

printf("NO\n");

}

return 0;
}

回复

使用道具 举报

千问 | 2011-8-5 14:27:26 | 显示全部楼层
我运行正常,我的环境是xp sp3+vc6.0我猜可能是你的输入格式问题,%f %f中间有空格,输入时应该输入1 2,而不是1,2...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行