View Code of Problem 3308

#include<stdio.h>
#include<string.h>
int main()
{
	char a[3000];
	while(scanf("%s",a)!=EOF)
	{
		if(strcmp(a,"ENDOFINPUT")==0)  break;
		gets(a);
		for(int i=0;i<strlen(a);i++)
		{
			if(a[i]>='F'&&a[i]<='Z')
			printf("%c",a[i]-5);
			else if(a[i]>='A'&&a[i]<='E')
			printf("%c",a[i]+21);
			else printf("%c",a[i]);
		}
		printf("\n");
		scanf("%s",a);
	}
 } 

Double click to view unformatted code.


Back to problem 3308