HDU 1.1.3 A+B for Input-Output Practice (III)
#include <stdio.h>
int main()
{
int a,b;
while((scanf("%d %d",&a,&b)!=EOF)&&(a!=0!=b))
{
printf("%d\n",a+b);
}
return 0;
}
本文介绍了一道经典的输入输出练习题——HDU 1.1.3 A+B问题的解决方案。该题要求读取多组整数对,并输出每组整数的和。代码使用C语言实现,通过while循环和scanf函数进行输入,利用printf函数输出计算结果。
HDU 1.1.3 A+B for Input-Output Practice (III)
#include <stdio.h>
int main()
{
int a,b;
while((scanf("%d %d",&a,&b)!=EOF)&&(a!=0!=b))
{
printf("%d\n",a+b);
}
return 0;
}
被折叠的 条评论
为什么被折叠?