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

1A贴代码

Posted by jinhouyu at 2015-05-02 15:15:18 on Problem 2608
#include<stdio.h>
#include<string.h>
char str[7][10]={"AEIOUHWY","BFPV","CGJKQSXZ","DT","L","MN","R"};
int main()
{
	char ch;
	int i,j,k=1,num[25];
	num[0]=0;
	while((ch=getchar())!=EOF)
	{	
		if(ch=='\n')
		{
			num[0]=0;
			k=1;
			putchar(ch);
		}	
		for(i=0;i<7;i++)
		{
			for(j=0;str[i][j]&&str[i][j]!=ch;j++);
			if(str[i][j]&&num[k-1]!=i)
			{
				if(i!=0)
					printf("%d",i);
				num[k++]=i;	
			}	
		}			
	}
	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