| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么还是不过呢???In Reply To:Re:为什么Sample Input 和Sample Output都对,还是WA呢? Posted by:xinqing8712 at 2008-05-12 10:20:15 #include<iostream>
#include<string.h>
using namespace std;
int main()
{
char a[200];
gets(a);
while(a[0]!='#')
{
long sum=0;
for(int i=0;a[i]!='\0';i++)
{
if(a[i]>=65&&a[i]<=90) sum+=(i+1)*int(a[i]-64);
if(a[i]>=97&&a[i]<=122) sum+=(i+1)*int(a[i]-96);
}
printf("%d\n",sum);
gets(a);
}
return 0;
}
> 貌似输入不限于大写字母。。。
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator