下面是使用C语言计算用户输入数值的和并显示且允许输入多组的代码。
#include <stdio.h>
//#include <stdlib.h>
int main()
{
int a, b;
while (scanf_s("%d%d", &a, &b) != EOF)
{
printf("%d\n", a + b);//
}
//system("pause");
return 0;
}
下面是使用C语言计算用户输入数值的和并显示且允许输入多组的代码。
#include <stdio.h>
//#include <stdlib.h>
int main()
{
int a, b;
while (scanf_s("%d%d", &a, &b) != EOF)
{
printf("%d\n", a + b);//
}
//system("pause");
return 0;
}