| ||||||||||
| 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 | |||||||||
you'd better read this problem again... (not that easy)In Reply To:1171.我怎么老是wrong answer啊,好郁闷啊 Posted by:clean at 2005-04-22 14:14:56 > #include<iostream>
> #include<cstdlib>
> #include<cstring>
> using namespace std;
> int main()
> {
> int max,j,score=0;
> long int i=0;
> char a[20];
> while(cin>>a)
> {
> max=0;
> if(a[0]=='.')break;
> if(i>40000)exit(0);
> for(j=0;j<20;j++)
> {
> if(a[j]=='e'||a[j]=='s'||a[j]=='i')
> max=max+1;
> if(a[j]=='a'||a[j]=='r'||a[j]=='t'||a[j]=='n')
> max=max+2;
> if(a[j]=='l'||a[j]=='o')
> max=max+3;
> if(a[j]=='c'||a[j]=='d'||a[j]=='u')
> max=max+4;
> if(a[j]=='b'||a[j]=='g'||a[j]=='h'||a[j]=='m'||
> a[j]=='p'||a[j]=='y')
> max=max+5;
> if(a[j]=='w'||a[j]=='f'||a[j]=='v'||a[j]=='k')
> max=max+6;
> if(a[j]=='q'||a[j]=='z'||a[j]=='x'||a[j]=='j')
> max=max+7;
> if(score<max)score=max;
> }
> i++;
> }
> cout<<score;
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator