题目大意:把输入字母转换,具体转换见原文。
Input to this problem will consist of a (non-empty) series of up to 100 data sets?这难道不是输入不能超过100个字符的意思?,数组开110根本过不了。很坑的一道题。
#include <stdio.h>
#include <string.h>
int main()
{
char f[210],start[11],end[4];
int i,len;
while(1)
{
gets(start);
if(strcmp(start,"ENDOFINPUT")==0)
return 0;
gets(f);
gets(end);
len=strlen(f);
for(i=0;i<len;i++)
{
if(f[i]>='A'&&f[i]<='Z')
{
if((f[i]-5)<'A')
f[i]+=26;
printf("%c",f[i]-5);
}
else
printf("%c",f[i]);
}
printf("\n");
}
return 0;
}