#3561
Playfair
Să se cripteze sau să se decripteze un mesaj folosind cifrul Playfair
.
cifrul Playfair
Problema | Playfair | Operații I/O |
![]() playfair.in /playfair.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #43003068 | Utilizator | |
Fișier | playfair.cpp | Dimensiune | 1.63 KB |
Data încărcării | 27 Martie 2023, 00:04 | Scor / rezultat | 20 puncte |
playfair.cpp: In function 'void encryptedMessage(std::string)': playfair.cpp:17:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<s.size(); i+=2) ^ playfair.cpp: In function 'void decryptedMessage(std::string)': playfair.cpp:31:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<s.size(); i+=2) ^ playfair.cpp:38:42: warning: statement has no effect [-Wunused-value] int n=c1-1, m=c2-1; if(n<0) n==4; if(m<0) m==4; ^ playfair.cpp:38:56: warning: statement has no effect [-Wunused-value] int n=c1-1, m=c2-1; if(n<0) n==4; if(m<0) m==4; ^ playfair.cpp:41:42: warning: statement has no effect [-Wunused-value] int n=c1-1, m=c2-1; if(n<0) n==4; if(m<0) m==4; ^ playfair.cpp:41:56: warning: statement has no effect [-Wunused-value] int n=c1-1, m=c2-1; if(n<0) n==4; if(m<0) m==4; ^ playfair.cpp: In function 'int main()': playfair.cpp:54:22: warning: array subscript has type 'char' [-Wchar-subscripts] v[a[i][j]]=1; ^ playfair.cpp: In function 'void encryptedMessage(std::string)': playfair.cpp:22:43: warning: 'c2' may be used uninitialized in this function [-Wmaybe-uninitialized] if(l1!=l2 && c1!=c2){s[i]=a[l1][c2];s[i+1]=a[l2][c1]; ^ playfair.cpp:22:60: warning: 'l2' may be used uninitialized in this function [-Wmaybe-uninitialized] if(l1!=l2 && c1!=c2){s[i]=a[l1][c2];s[i+1]=a[l2][c1]; ^ playfair.cpp:23:47: warning: 'l1' may be used uninitialized in this function [-Wmaybe-uninitialized] } else if(l1==l2) {s[i]=a[l1][(c1+1)%5];s[i+1]=a[l2][(c2+1)%5]; } ^ playfair.cpp:23:42: warning: 'c1' may be used uninitialized in this function [-Wmaybe-uninitialized] } else if(l1==l2) {s[i]=a[l1][(c1+1)%5];s[i+1]=a[l2][(c2+1)%5]; } ^ playfair.cpp: In function 'void decryptedMessage(std::string)': playfair.cpp:36:43: warning: 'c2' may be used uninitialized in this function [-Wmaybe-uninitialized] if(l1!=l2 && c1!=c2){s[i]=a[l1][c2];s[i+1]=a[l2][c1]; ^ playfair.cpp:36:60: warning: 'l2' may be used uninitialized in this function [-Wmaybe-uninitialized] if(l1!=l2 && c1!=c2){s[i]=a[l1][c2];s[i+1]=a[l2][c1]; ^ playfair.cpp:39:25: warning: 'l1' may be used uninitialized in this function [-Wmaybe-uninitialized] s[i]=a[l1][n];s[i+1]=a[l2][m]; } ^ playfair.cpp:42:32: warning: 'c1' may be used uninitialized in this function [-Wmaybe-uninitialized] s[i]=a[(l1+1)%5][c1]; s[i+1]=a[(l2+1)%5][c2]; } ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 10 | 10 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
3 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
5 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
8 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
9 | 0 secunde | OK. | 10 | 10 | ||
10 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 20 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Playfair 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ă.