View Code of Problem 3308

#include<stdio.h>
#include<string.h>
int main(){
	int i;
	char start[10],end[10],endinput[20],conte[201];
	 
	 while(gets(start)!=NULL){
	 
 		if(strcmp(start,"ENDOFINPUT")==0){
		 	break;
		 }else {
			gets(conte);
 			for(i=0;i<strlen(conte);i++){
 			
			 	if(conte[i]>='A'&&conte[i]<='Z'){
			 		if(conte[i]-5<'A'){
		 				printf("%c",'Z'-('A'-(conte[i]-5))+1);
		 			}else
	 				printf("%c",conte[i]-5);
	 			}else{
			 		printf("%c",conte[i]);
			 	}
			 }
 		}
 		printf("\n");
 		gets(end);
 	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 3308