#2615
Se citește un text. Se cere criptarea/decriptarea acestuia folosind Cifrul Caesar.
Probleme de Criptografie
| Problema | CaesarCrypt | Operații I/O |
caesar.in/dbftbs.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64620393 | Utilizator | |
| Fișier | caesarcrypt.cpp | Dimensiune | 622 B |
| Data încărcării | 18 Mai 2026, 23:57 | Scor/rezultat | 8 puncte |
caesarcrypt.cpp: In function ‘void encrypt(char*, int)’: caesarcrypt.cpp:9:18: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 9 | if(s[i]>='A'&& s[i]<='Z' || s[i]>='a'&& s[i]<='z') | ~~~~~~~~~^~~~~~~~~~~~ caesarcrypt.cpp:9:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | if(s[i]>='A'&& s[i]<='Z' || s[i]>='a'&& s[i]<='z') | ^~ caesarcrypt.cpp:6:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 6 | #define cout out | ^~~ caesarcrypt.cpp:11:7: note: in expansion of macro ‘cout’ 11 | cout<< s; | ^~~~ caesarcrypt.cpp: In function ‘void decrypt(char*, int)’: caesarcrypt.cpp:15:17: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 15 | if(s[i]>='A'&& s[i]<='Z' || s[i]>='a'&& s[i]<='z') | ~~~~~~~~~^~~~~~~~~~~~ caesarcrypt.cpp:15:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if(s[i]>='A'&& s[i]<='Z' || s[i]>='a'&& s[i]<='z') | ^~ caesarcrypt.cpp:6:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 6 | #define cout out | ^~~ caesarcrypt.cpp:17:7: note: in expansion of macro ‘cout’ 17 | cout<< s; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 4 | 4 | Exemplu | |
| 2 | 0.001 secunde | OK. | 4 | 4 | Exemplu | |
| 3 | 0.002 secunde | Raspuns gresit. | 4 | 0 | Exemplu | |
| 4 | 0.001 secunde | Raspuns gresit. | 4 | 0 | Exemplu | |
| 5 | 0.001 secunde | Raspuns gresit. | 4 | 0 | Exemplu | |
| 6 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 8 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CaesarCrypt face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.