#include
int main()
{
int a[10];
int num,const=0,sum=0;
printf("请输入10个整数:");
for(num=0;num<10;num++)
{
scanf(%d,&a[num]);
const++;
printf("你已输入%d个整数 ",const);
sum+=a[num];
}
printf("所输入的整数和是: %d",sum);
return 0;
}
#include
int main()
{
int count; sum=0, num;
int a[10];
for(count=0;count<10;count++)
{
scanf("%d", &num);
a[count]=num;
sum+=num;
}
printf("ten numbsers : ");
for(count=0;count<10;count++)
printf("%d ", a[count]);
printf("\n");
printf("sum is %d\n", sum);
}
#include
int main(){
int a[10],i,sum=0;
printf("Please input 10 numbers:");
for(i=0;i<10;i++){
scanf(%d,&a[i]);
sum+=a[i];
}
printf("sum is %d",sum);
return 0;
}