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:提交后怎么结果总是错? Posted by:2_040430224 at 2005-12-28 15:55:01 > #include "iostream.h" > #include "string.h" > void main( ) > { > char string[40000][8]; > int i=-1; > int temp; > do{ > i++; > cin>>string[i]; > }while(string[i][0]!='.'); > int *iptr=new int[i]; > for(int j=0;j<i;j++) > { > iptr[j]=0; > } > for(int count=0;count<i;count++) > { > for(int k=0;k<(int)strlen(string[count]);k++) > { > switch(string[count][k]){ > case 'a': > case 'r': > case 't': > case 'n': > iptr[count]=iptr[count]+2; > break; > case 'b': > case 'm': > case 'g': > case 'h': > case 'y': > case 'p': > iptr[count]=iptr[count]+5; > break; > case 'c': > case 'd': > case 'u': > iptr[count]=iptr[count]+4; > break; > case 'e': > case 'i': > case 's': > iptr[count]=iptr[count]+1; > break; > case 'f': > case 'k': > case 'v': > case 'w': > iptr[count]=iptr[count]+6; > break; > case 'j': > case 'z': > case 'x': > case 'q': > iptr[count]=iptr[count]+7; > break; > case 'l': > case 'o': > iptr[count]=iptr[count]+3; > break; > } > } > } > int max=iptr[0]; > for(count=1;count<i;count++) > { > if(max<iptr[count]) > { > temp=max; > max=iptr[count]; > iptr[count]=temp; > } > } > cout<<max<<endl; > delete []iptr; > > > } > > > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator