nyoj-400-I'll play a trick on you
2013-09-19 12:26
369 查看
#include<stdio.h>
#include<string.h>
char a[210];
int main()
{
int s;
scanf("%d",&s);
getchar();
while(s--)
{
int n,t,i;
gets(a);
t=0;
n=strlen(a);
for(i=0;i<n;i++)
if(a[i]>='0'&&a[i]<='9')
t+=a[i]-48;
printf("%d\n",t);
}
return 0;
}
#include<string.h>
char a[210];
int main()
{
int s;
scanf("%d",&s);
getchar();
while(s--)
{
int n,t,i;
gets(a);
t=0;
n=strlen(a);
for(i=0;i<n;i++)
if(a[i]>='0'&&a[i]<='9')
t+=a[i]-48;
printf("%d\n",t);
}
return 0;
}
相关文章推荐
- NYOJ 400 I'll play a trick on you
- NYOJ 400题 I'll play a trick on you
- NYOJ 题目400 I'll play a trick on you
- 南阳oj 400 I'll play a trick on you (细节规律题 简单的字符串处理)
- 2011 Alibaba Programming Contest_1003_I'll play a trick on you
- I'll play a trick on you
- hdu 3953 I'll play a trick on you
- HDu--3935(I'll play a trick on you)
- HDU:3953 I'll play a trick on you
- I'll play a trick on you
- HDU3953 I'll play a trick on you
- hdu 3953 I'll play a trick on you (递推)
- hdu 3953 I'll play a trick on you (递推)
- ACM_ I'll play a trick on you
- hdu 3953 I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 / 1003 I'll play a trick on you
- I'll play a trick on you(2011 Alibaba Programming Contest)
- ACM-I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 / 1003 I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 1003 I'll play a trick on you