2009-04-04 13:52:51來源不明
態度之重要的證明
/*************************************/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
main()
{
char x[201];
int a,b,temp,flag=1;
while(gets(x))
{
temp=0;flag=1;
if(x[0]!=48||(x[0]==48&&x[1]!=0))
{
for(a=0;a<strlen(x);a++)
{
if(x[a]>=65&&x[a]<=90)
{
flag=2;
temp=temp+(x[a]-64);
}
else if(x[a]>=97&&x[a]<=122)
{
flag=2;
temp=temp+(x[a]-96);
}
else {printf("Fail");flag=1;break;}
}
if(flag==2) printf("%d",temp);
}
printf("\n");
}
return 0;
}
上一篇:電腦教室