题目:http://poj.org/problem?id=1298
好吧,给了题目也看不懂……给出翻译(题目名翻译是:最难的问题,233333)
这一看就是老师给出题解:
然而没有什么用哈
最快的办法是,把下面的密文直接拷过来,建个字符数组
然后读入,判断是否是 ENDOFINPUT
不是就读入原文,把大写字母翻译出来
记得换行
最后读掉 END
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std; const char hs[]={'V','W','X','Y','Z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U'};
char s[];
int main()
{
int i,len;
while ()
{
gets(s);
if (s[]=='E'&&s[]=='N'&&s[]=='D'&&s[]=='O'&&s[]=='F'&&s[]=='I'&&s[]=='N'&&s[]=='P'&&s[]=='U'&&s[]=='T'&&s[]=='\0') return ;
gets(s);
len=strlen(s);
for (i=;i<len;i++)
{
if (s[i]>='A'&&s[i]<='Z') putchar(hs[s[i]-'A']);
else putchar(s[i]);
}
putchar('\n');
gets(s);
}
}
版权所有,转载请联系作者,违者必究