| ||||||||||
| 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 | |||||||||
1A贴代码#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator