就是给定test case的输入求和
推荐用while(T--)来控制次数
#include <cstdio>
using namespace std;
int main()
{
int i,a,b,N;
scanf("%d",&N);
while(N--){
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
return 0;
}
本文介绍了使用while循环实现对给定测试案例输入求和的方法,涵盖了基本的输入读取和输出格式化。
就是给定test case的输入求和
推荐用while(T--)来控制次数
#include <cstdio>
using namespace std;
int main()
{
int i,a,b,N;
scanf("%d",&N);
while(N--){
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
return 0;
} 
被折叠的 条评论
为什么被折叠?