All pastes #270451 Raw Edit

Untitled

public text v1 · immutable
·published 2006-12-07 11:17 UTC
rendered paste body
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>


main() {
char frase[1000];
int i;
char converte(char c);

printf("Digite a frase para ser descriptografada:\n\n");
fflush(stdin);
gets(frase);
strupr(frase);
for(i=0;i<strlen(frase);i++) {
frase[i] = converte(frase[i]);
}
system("cls");
printf("Frase descriptografada:\t");
puts(frase);
getche();


}

char converte(char c) {
if(c == 'Z') { c = 'P'; return(c);}
if(c == 'E') { c = 'O'; return(c);}
if(c == 'N') { c = 'L'; return(c);}
if(c == 'I') { c = 'A'; return(c);}
if(c == 'T') { c = 'R'; return(c);}
if(c == 'P') { c = 'Z'; return(c);}
if(c == 'O') { c = 'E'; return(c);}
if(c == 'L') { c = 'N'; return(c);}
if(c == 'A') { c = 'I'; return(c);}
if(c == 'R') { c = 'T'; return(c);}
return(c);

}