输入数据有多组。 每组一行,为整数A, B。 以EOF做结束。 该怎么写?(C语言)

样例输入1 23 4样例输出37

第1个回答  2013-05-09
#include <stdio.h>
#include <stdlib.h>
int main()
{ int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
{
scanf("%d %d",&a,&b);
printf("%d\n",a+b);
}
return 0;
}本回答被网友采纳
第2个回答  2017-10-22
#include <stdio.h>
int main()
{
int A,B;
while(scanf("%d%d",&A,&B)!=EOF)
{
printf("%d\n",A+B);
}
return 0;
}
相似回答