[ZJ]b581: 一串加
題目:
http://zerojudge.tw/ShowProblem?problemid=b581
-----------------------------------------------------------------------------------------
#include<cstdio>
#define maxn 1000+1
typedef long long int LL;
int main()
{
int T;
scanf("%d",&T);
while(T-->0)
{
LL a = 0,ans = 0;
do{
scanf("%lld",&a);
ans = ans + a;
}while(getchar()!='\n');
printf("%lld\n",ans);
}
return 0;
}
http://zerojudge.tw/ShowProblem?problemid=b581
-----------------------------------------------------------------------------------------
#include<cstdio>
#define maxn 1000+1
typedef long long int LL;
int main()
{
int T;
scanf("%d",&T);
while(T-->0)
{
LL a = 0,ans = 0;
do{
scanf("%lld",&a);
ans = ans + a;
}while(getchar()!='\n');
printf("%lld\n",ans);
}
return 0;
}
留言
張貼留言