Posted on 2009-07-02 15:14
Hero 阅读(127)
评论(0) 编辑 收藏 引用 所属分类:
代码如诗--ACM
1 //HLOJ 1146 Accepted 0 196 623 C++
2
3 #include <iostream>
4 using namespace std ;
5
6 char str[330] ;
7
8 int main()
9 {
10 while( gets( str ) )
11 {
12 if( strcmp( str, "END" ) == 0 ) break ;
13
14 int len = strlen( str ) ;
15 for( int i=0; i<len; i++ )
16 {
17 if( str[i]=='A'||str[i]=='W'||str[i]=='F' ) str[i] = 'I' ;
18 else if( str[i]=='C' ) str[i] = 'L' ;
19 else if( str[i]=='M' ) str[i] = 'o' ;
20 else if( str[i]=='S' ) str[i] = 'v' ;
21 else if( str[i]=='D'||'P'==str[i]||'G'==str[i]||'B'==str[i] ) str[i] = 'e' ;
22 else if( 'L'==str[i] ) str[i] = 'Y' ;
23 else if( 'X'==str[i] ) str[i] = 'u' ;
24 }
25
26 printf( "%s\n", str ) ;
27 }
28 return 0 ;
29 }