Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

新手

Posted by 20101003712 at 2011-11-05 01:07:00 on Problem 3094
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator