START NS BFW, JAJSYX TK NRUTWYFSHJ FWJ YMJ WJXZQY TK YWNANFQ HFZXJX END START N BTZQI WFYMJW GJ KNWXY NS F QNYYQJ NGJWNFS ANQQFLJ YMFS XJHTSI NS WTRJ END START IFSLJW PSTBX KZQQ BJQQ YMFY HFJXFW NX RTWJ IFSLJWTZX YMFS MJ END ENDOFINPUT
IN WAR, EVENTS OF IMPORTANCE ARE THE RESULT OF TRIVIAL CAUSES I WOULD RATHER BE FIRST IN A LITTLE IBERIAN VILLAGE THAN SECOND IN ROME DANGER KNOWS FULL WELL THAT CAESAR IS MORE DANGEROUS THAN HE
源代码一:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char stra[110];
char start[5],end[3];
int main()
{
int i;
while(gets(start) && strcmp(start,"ENDOFINPUT") != 0)
{
memset(stra,'\0',strlen(stra));
gets(stra);
for(i = 0;stra[i]!='\0';i++)
{
if(stra[i] >= 'A' && stra[i] <= 'E')
stra[i] += 21;
else if(stra[i] >= 'F' && stra[i] <= 'Z')
stra[i] -= 5;
}
gets(end);
puts(stra);
}
system("pause");
return 0;
}
源代码二:
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
char a[27]="VWXYZABCDEFGHIJKLMNOPQRSTU";
char str[1000];
int i,len;
while(cin.getline(str,1000))
{
if(strcmp(str,"ENDOFINPUT")==0)
break;
if(strcmp(str,"START")!=0&&strcmp(str,"END")!=0)
{
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]>='A'&&str[i]<='Z')
printf("%c",a[str[i]-'A']);
else
printf("%c",str[i]);
}
cout<<endl;
}
}
system("pause");
return 0;
}