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 dlut_student_a at 2007-05-13 18:14:43 on Problem 1002
#include<iostream.h>
#include<stdio.h>
#include<string.h>
void main()
{
    int n,i,s=0,k=0;
    char num[10000][14],j;
    cin>>n;
    for(i=0;i<n;i++)
    {     
		gets(num[i]);
		k=0;
		s=0;
          while(k<14&&s<7)
          {
          j=num[i][k];
          if(j=='0')
		  {
			  num[i][s]='0';
				s++;k++;
				continue;
		  }
		  else if(j=='1')
		  {	num[i][s]='1';k++;	s++;
				continue;
		  }
		  else if(j=='2'||(j>='A'&&j<='C')) 
		  { num[i][s]='2';	s++;k++;
				continue;
		  }
		  else if(j=='3'||(j>='D'&&j<='F')) 
		  { num[i][s]='3';	s++;k++;
				continue;
		  }
		  else if(j=='4'||j=='G'||j=='H'||j=='I') 
		  { num[i][s]='4';	s++;k++;
				continue;
		  }
		  else if(j=='5'||j=='J'||j=='K'||j=='L') 
		  { num[i][s]='5';	s++;k++;
				continue;
		  }
		  else if(j=='6'||j=='N'||j=='O'||j=='M')
		  { num[i][s]='6';	s++;k++;
				continue;
		  }
		  else if(j=='7'||j=='P'||j=='R'||j=='S') 
		  { num[i][s]='7';	s++;k++;
				continue;
		  }
		  else if(j=='8'||j=='T'||j=='U'||j=='V') 
		  {	  num[i][s]='8';	s++;k++;
				continue;
		  }
		  else if(j=='9'||j=='W'||j=='X'||j=='Y') 
		  {  num[i][s]='9';	s++;k++;
				continue;
		  }
		  else if(j=='\n')
			  break;
           
		  else {k++;continue;}}
     }
     for(i=0;i<n;i++)
     {
	 s=0;
	 for(k=i+1;k<n;k++)
			 {
		 
		
			 if((num[i][0]!='Z')&&( num[k][0]!='Z')&&(!strcmp(num[i],num[k])))
			s++;
		
			 }
cout<<num[i][0]<<num[i][1]<<num[i][2]<<'-'<<num[i][3]<<num[i][4]<<num[i][5]<<num[i][6]<<' '<<s+1<<endl;
	 }
}        

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