注意asc码
#include <fstream>
#include <string.h>
#include <stdio.h>
#define _cdebbug
//全局数据
void decode(char *codes)
{
int len ;
int i,j ;
len = strlen(codes) ;
for (i = 0 ; i < len ; ++i)
if ( codes[i] <= 'Z' && codes[i] >= 'A')
printf("%c", ( (codes[i] - 'A'- 5 + 'Z' - 'A' + 1 )%('Z' -'A'+1) +'A' ) );
else
printf("%c",codes[i]) ;
printf("\n") ;
}
int main()
{
//重定向
#ifdef _cdebbug
freopen("F:\\input.txt","r",stdin );
#endif
int i,j ;
char codescript[300] ;
char temp[20] ;
while(1)
{
gets(temp) ;
if (!strcmp(temp,"ENDOFINPUT") )
break ;
gets(codescript) ;
decode(codescript) ;
gets(temp) ;
}
//解除重定向关闭文件
#ifdef _cdebbug
fclose(stdin);
#endif
return 0 ;
}