1092 A+B for Input-Output Practice(IV)
2013-07-26 16:03
661 查看
#include<stdio.h>
int main()
{
int n,a,i,s[10000];
while(scanf("%d",&n)&&n!=0)
{
a=0;
for(i=0;i<n;i++)
scanf("%d",&s[i]);
for(i=0;i<n;i++)
a=a+s[i];
printf("%d\n",a);
} return 0;
}
题目没有说范围,只好自己定义了一个大的数组,程序通过了;考察基本的输入。
int main()
{
int n,a,i,s[10000];
while(scanf("%d",&n)&&n!=0)
{
a=0;
for(i=0;i<n;i++)
scanf("%d",&s[i]);
for(i=0;i<n;i++)
a=a+s[i];
printf("%d\n",a);
} return 0;
}
题目没有说范围,只好自己定义了一个大的数组,程序通过了;考察基本的输入。
相关文章推荐
- 1092 A+B for Input-Output Practice (IV)
- 【杭电】[1092]A+B for Input-Output Practice (IV)
- HDOJ 1092 A+B for Input-Output Practice (IV)
- hduoj1092,A+B for Input-Output Practice (IV)
- hduoj1092(A+B for Input-Output Practice (IV))
- hdoj 1092 A+B for Input-Output Practice (IV)
- HDOJ 1092:A+B for Input-Output Practice (IV)
- 1092 A+B for Input-Output Practice (IV)
- HDOJ 1092 A+B for Input-Output Practice (IV)(水题)
- HDU 1092 A+B for Input-Output Practice (IV)
- hdu 1092 A+B for Input-Output Practice (IV)
- 杭电 HDU 1092 A+B for Input-Output Practice (IV)
- HDU-1092 A+B for Input-Output Practice (IV)
- HDOJ 1092 A+B for Input-Output Practice (IV)
- 【HDU】1092 A+B for Input-Output Practice (IV)
- Hdoj 1092 A+B for Input-Output Practice (IV)
- HDOJ 1092 A+B for Input-Output Practice (IV)
- 杭电ACM 1092(A+B for Input-Output Practice (IV))
- HDOJ1092 A+B for Input-Output Practice (IV)
- hd-1092:A+B for Input-Output Practice (IV)