#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 | #60172893 | Utilizator | |
| Fișier | caesarcrypt.cpp | Dimensiune | 1.80 KB |
| Data încărcării | 20 Octombrie 2025, 16:47 | Scor/rezultat | 60 puncte |
caesarcrypt.cpp: In function 'int main()': caesarcrypt.cpp:24:17: warning: array subscript has type 'char' [-Wchar-subscripts] poz[nr++] = i; ^ caesarcrypt.cpp:27:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < strlen(sir); i++) ^ caesarcrypt.cpp:38:46: warning: array subscript has type 'char' [-Wchar-subscripts] if(nr_litere < poz[sir[i]]+dif) ^ caesarcrypt.cpp:39:62: warning: array subscript has type 'char' [-Wchar-subscripts] sir[i] = lit[dif-nr_litere+poz[sir[i]]]; ^ caesarcrypt.cpp:28:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(isalpha(sir[i])) ^ caesarcrypt.cpp:47:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < strlen(sir); i++) ^ caesarcrypt.cpp:59:38: warning: array subscript has type 'char' [-Wchar-subscripts] if(0 > poz[sir[i]]-dif) ^ caesarcrypt.cpp:60:58: warning: array subscript has type 'char' [-Wchar-subscripts] sir[i] = lit[nr_litere+poz[sir[i]]-dif]; ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | OK. | 4 | 4 | Exemplu | |
| 2 | 0 secunde | OK. | 4 | 4 | Exemplu | |
| 3 | 0 secunde | OK. | 4 | 4 | Exemplu | |
| 4 | 0 secunde | OK. | 4 | 4 | Exemplu | |
| 5 | 0 secunde | OK. | 4 | 4 | Exemplu | |
| 6 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| 7 | 0 secunde | OK. | 20 | 20 | ||
| 8 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| 9 | 0 secunde | OK. | 20 | 20 | ||
| Punctaj total | 60 | |||||
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ă.