I have a question, I'm making an algorithm that takes the user's phrase that does not have sense, as if it were a code, to solve it has a key that is the letters that come out most of the Portuguese alphabet, to solve I have to associate each letter of the text with the most used letter in Portuguese, EX c = a, z = o and so on, I made the code only it does not change is always the same letter that the user typed. could anyone give me some tips. '# include
#include <string.h>
main()
{
char chave[20],texto[20],frase[20];
int size,i;
printf("Digite o texto para ser alterado: ");
scanf("%s",chave);
size=strlen(chave);
strcpy(texto,chave);
for(i=0;i<size;i++)
{
if (frase[i]=='c')
frase[i]='a';
else if (texto[i]=='b')
frase[i]='s';
else if (texto[i]=='d')
frase[i]='e';
else if (texto[i]=='e')
frase[i]='d';
}
printf("Texto original:\n%s\n Novo texto:\n%s\n",chave,texto);
}