hdu 1048

来源:互联网 发布:python图像处理opencv 编辑:程序博客网 时间:2024/05/21 19:43

题目大意:把输入字母转换,具体转换见原文。

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);}elseprintf("%c",f[i]);}printf("\n");}return 0;}


0 0
原创粉丝点击