题号:1001
#include<stdio.h>
int main(){
int a,b,i,sum;
while(scanf("%d",&a)!=EOF){
sum=0;
for(i=1;i<=a;i++){
sum+=i;
}
printf("%d\n\n",sum);
}
return 0;
}
题号1092:
#include<stdio.h>
int main(){
int n,sum,a,i,j;
while(scanf("%d",&n)!=EOF){
sum=0;
for(i=0;i<n;i++){
scanf("%d",&a);
sum+=a;
}
if(i==0){
break;
}else{
printf("%d\n",sum);
}
}
}
题号1093:
#include<stdio.h>
int main(){
int n,sum,a,i,j=0,h;
scanf("%d",&n);
while(scanf("%d",&h)!=EOF){
sum=0;
for(i=0;i<h;i++){
scanf("%d",&a);
sum+=a;
}
printf("%d\n",sum);
j=j+1;
if(j==n){
break;
}
}
return 0;
}
1094题号:
#include<stdio.h>
int main(){
int n,a,sum,i;
while(scanf("%d",&n)!=EOF){
sum=0;
for(i=0;i<n;i++){
scanf("%d",&a);
sum+=a;
}
printf("%d\n",sum);
}
return 0;
}
题号:1094
#include<stdio.h>
int main(){
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d\n\n",a+b);
}
return 0;
}
题目1095:
#include<stdio.h>
int main(){
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d\n\n",a+b);
}
return 0;
}
题目1096:
#include<stdio.h>
int main(){
int a,b,n,h,sum,j=0,i;
scanf("%d",&n);
while(scanf("%d",&h)!=EOF){
sum=0;
for(i=0;i<h;i++){
scanf("%d",&a);
sum+=a;
}
printf("%d\n",sum);
j++;
if(j!=n){
printf("\n");
}else{
break;
}
}
return 0;
}
题号:2000
#include<stdio.h>
int main(){
char a,b,c,max;
while(scanf("%c%c%c",&a,&b,&c)!=EOF){
if(a>b){
max=a;
a=b;
b=max;
}
if(b>c){
max=b;
b=c;
c=max;
}
if(a>b){
max=a;
a=b;
b=max;
}
printf("%c %c %c\n",a,b,c);
getchar();
}
return 0;
}
2010题
#include<stdio.h>
#include<math.h>
int main(){
int a[10],c,d,i,x1,x2,x3,j[10],n,m,t;
c=0;
for(i=100;i<1000;i++){
x1=i/100;
x2=(i-x1*100)/10;
x3=i%10;
if(x1*x1*x1+x2*x2*x2+x3*x3*x3==i){
a[c]=i;
c++;
}
}
while(scanf("%d%d",&n,&m)!=EOF ){
if(n>m){
t=n;
n=m;
m=t;
}
d=0;
for(i=0;i<c;i++){
if(a[i]<=m&&a[i]>=n){
j[d]=i;
d++;
}
}
if(d){
for(i=0;i<d-1;i++)
printf("%d ",a[j[i]]);
printf("%d\n",a[j[i]]);
}else{
printf("no\n");
}
}
return 0;
}