TOPIC
Presentation error
Lúcia Valéria de Novaes Neves asked 1 year ago
Alguem pode me ajudar.
No CodeBlocks os resultados estão iguais do exercicio.
MAs na compilação esta dando erro de apresentação. Eu não consegui entender o que o URI quer como saída.
A criptografia está correta.
segue o fonte
include includeusing namespace std;
int main() { int n, i, j, nTam; string str, aux;
cin>>n;
for (i = 0; i <= n; i ++) {
str = "";
aux = "";
getline(cin, str);
nTam = str.size();
// 1o Passo
for(j=0; j < nTam; j++){
if ((str[j] >= 'A' && str[j] <= 'Z') || (str[j] >= 'a' && str[j] <= 'z')) {
str[j] += 3;
}
}
// 2o Passo
for(j = (nTam - 1); j >= 0 ; j--){
aux = aux + str[j];
}
str = aux;
// 3o passo
for(j=(( nTam / 2)); j < nTam; j++){
str[j] -= 1;
}
cout<<str<<endl;
}
cout<<endl; return 0; }
This topic has not been answered yet. Be the first!