| ||||||||||
| 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:水题,没有开数组,0MS,贴代码,供参考 Posted by:denganliang at 2011-03-23 14:41:53 #include<stdio.h>
int main()
{
char c;
while((c = getchar()) != '#')
{
int i = 1;
long int sum = 0;
do
{
sum += i * (c == ' ' ? 0 : c - 'A' + 1);
i ++;
}while((c = getchar()) != 10);
printf("%ld\n", sum);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator