A + B Problem(1000)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 355051 Accepted Submission(s): 110841
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
sum=a+b;
printf("%d\n",sum);
}
return 0;
}
Sum Problem(1001)
Time Limit: 1000/500 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 237995 Accepted Submission(s): 58229
In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.
may assume the result will be in the range of 32-bit signed integer.
#include<stdio.h>
int main()
{
int n,i,sum; while(scanf("%d",&n)!=EOF)
{
for(sum=0,i=0;i<=n;i++)
sum=sum+i;
printf("%d\n\n",sum);
}
return 0;
}
A+B for Input-Output Practice (I)(1089)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 68193 Accepted Submission(s): 37929
were designed for the same aim.
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
sum=a+b;
printf("%d\n",sum);
}
return 0;
}
A+B for Input-Output Practice (II)(1090)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51355 Accepted Submission(s): 33780
#include<stdio.h>
int main()
{
int a,b,t,sum;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&a,&b);
sum=a+b;
printf("%d\n",sum);
}
return 0;
}
A+B for Input-Output Practice (III)(1091)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 60600 Accepted Submission(s): 31168
0 0 terminates the input and this test case is not to be processed.
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
if(a==0&&b==0)break;
sum=a+b;
printf("%d\n",sum); }
return 0;
}
A+B for Input-Output Practice (IV)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53974 Accepted Submission(s): 28848
processed.
#include<stdio.h>
int main()
{
int a[100],t,i,sum;
while(scanf("%d",&t)!=EOF)
{
if(t==0)
break;
sum=0;
for(i=1;i<=t;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("%d\n",sum);
}
return 0;
}
A+B for Input-Output Practice (V)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 39483 Accepted Submission(s): 26698
#include<stdio.h>
int main()
{
int a[100],t,i,p,sum;
scanf("%d",&p);
while(p--)
{
scanf("%d",&t);
if(t==0)
break;
sum=0;
for(i=1;i<=t;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("%d\n",sum);
}
return 0;
}
A+B for Input-Output Practice (VI)
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37174 Accepted Submission(s): 25051
#include<stdio.h>
int main()
{
int a[100],t,i,sum;
while(scanf("%d",&t)!=EOF)
{
sum=0;
for(i=1;i<=t;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("%d\n",sum);
}
return 0;
}
看到这里我只想说,大家做题时候,代码写的格式一定要规范,最好就是形式统一,该空的时候就空格,不然代码都一个水平面就美观了,而且以后比赛的时候你还有2个队友,让他们给你检查错误的话,你的代码又不整洁,那么效率肯定不会高的,而且会有厌烦的心态,那就更好了,所以大家以后写代码尽量规范一点。就是这样了!
A+B for Input-Output Practice (VII)
Time
Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 36617 Accepted Submission(s): 24438
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
sum=a+b;
printf("%d\n\n",sum);
}
return 0;
}
终于快结束了,,,,,,搞得好辛苦,大家一定要认真对待啊!
A+B for Input-Output Practice (VIII)
Time
Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 78908 Accepted Submission(s): 24263
10
easy! o(∩_∩)o 那么,,,
#include<stdio.h>
int main()
{
int a[100],t,i,p,sum;
scanf("%d",&p);
while(p--)
{
scanf("%d",&t);
sum=0;
for(i=1;i<=t;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("%d\n",sum);
if(p)//中间空行用
printf("\n");
}
return 0;
}
到现在为止,你已经学会acm的简单输入输出了,(当然不是所有的输入输出,这个留给以后慢慢学习好了,)那么现在你已经可以在杭电上A题了,(为自己鼓掌,哈哈),接下来大家可以从简单题下手,本人建议可以先做11页的题。
当然不会的题欢迎到群内讨论,QQ群: <主要面向刚刚入门的13级新生!>
最后还有一个小小的建议:学习贵在坚持!刚刚开始都是比较难的,所以大家要相互鼓励相互监督,共同进步!
谢谢你的浏览!o(∩_∩)o