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 davydc at 2006-01-17 21:01:56 on Problem 1171
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:
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