| ||||||||||
| 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 | |||||||||
新手#include<stdio.h>
int value( char c){
if( c == ' ')
return 0 ;
else return c - 'A' + 1 ;
}
int main()
{
long sum , i ;
char c ;
while( (c = getchar()) != '#'){
sum = 0 ; i = 1 ;
sum += (i++)* value(c) ;
while(( c= getchar() ) != '\n')
sum += (i++)*value(c) ;
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