#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);
}
return0;
}
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
Problem Description
Your task is to Calculate a + b. Too easy?! Of course! I specially designed the problem for acm beginners. You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
Input
The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{ sum=a+b;
printf("%d\n",sum);
}
return0;
}
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
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
#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);
}
return0;
}
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
Problem Description
Your task is to Calculate a + b.
Input
Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line.
A test case containing 0 0 terminates the input and this test case is not to be processed.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
#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);
}
return0;
}
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
Problem Description
Your task is to Calculate the sum of some integers.
Input
Input contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed.
Output
For each group of input integers you should output their sum in one line, and with one line of output for each line in input.
#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);
}
return0;
}
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
Problem Description
Your task is to calculate the sum of some integers.
Input
Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.
Output
For each group of input integers you should output their sum in one line, and with one line of output for each line in input.
#include<stdio.h>
int main()
{
int a,b,sum;
while(scanf("%d%d",&a,&b)!=EOF)
{
sum=a+b;
printf("%d\n\n",sum);
}
return0;
}
终于快结束了,,,,,,搞得好辛苦,大家一定要认真对待啊!
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
Problem Description
Your task is to calculate the sum of some integers.
Input
Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.
Output
For each group of input integers you should output their sum in one line, and you must note that there is a blank line between outputs.