简单acm题,为什么会wrong answer?
题目:DescriptionYourtaskistoCalculatea+b.InputTherearemultipletestcases.Eachtestcasecon...
题目:
Description
Your task is to Calculate a + b.
Input
There are multiple test cases. Each test case contains only one line. Each line consists of a pair of real number a and b(0<=a,b<=1000000), separated by a space.
Output
For each case, output the answer in one line rounded to 4 digits after the decimal point.
代码:
#include<stdio.h>
int main()
{
float a,b;
while(scanf("%f %f",&a,&b) != EOF)
{
printf("%.4f\n",(a + b));
}
return 0;
} 展开
Description
Your task is to Calculate a + b.
Input
There are multiple test cases. Each test case contains only one line. Each line consists of a pair of real number a and b(0<=a,b<=1000000), separated by a space.
Output
For each case, output the answer in one line rounded to 4 digits after the decimal point.
代码:
#include<stdio.h>
int main()
{
float a,b;
while(scanf("%f %f",&a,&b) != EOF)
{
printf("%.4f\n",(a + b));
}
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询