#3616
adfgx
Cifrul ADFGX
este un cifru care folosește o matrice pătratică 5x5
și o cheie
. În matricea pătratică, liniile și coloanele vor fi numerotate cu litere. Avem această matrice ca exemplu.
A D F G X A a b c d e D f g h i j F k l m n o G p q r s t X u v w x y
Problema | adfgx | Operații I/O |
adfgx.in /adfgx.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #42597100 | Utilizator | |
Fișier | adfgx.cpp | Dimensiune | 2.78 KB |
Data încărcării | 11 Martie 2023, 19:39 | Scor / rezultat | Eroare de compilare |
adfgx.cpp:26:22: error: 'vector' does not name a type string encrypt(const vector<vector<char>>& matrix, const string& key, const string& message) { ^ adfgx.cpp:26:22: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive] adfgx.cpp:26:28: error: expected ',' or '...' before '<' token string encrypt(const vector<vector<char>>& matrix, const string& key, const string& message) { ^ adfgx.cpp: In function 'std::string encrypt(int)': adfgx.cpp:27:5: error: 'vector' was not declared in this scope vector<Code> codes; // retinem codurile ADFGX ale mesajului ^ adfgx.cpp:27:16: error: expected primary-expression before '>' token vector<Code> codes; // retinem codurile ADFGX ale mesajului ^ adfgx.cpp:27:18: error: 'codes' was not declared in this scope vector<Code> codes; // retinem codurile ADFGX ale mesajului ^ adfgx.cpp:28:19: error: 'message' was not declared in this scope for (char c : message) { ^ adfgx.cpp:29:32: error: 'matrix' was not declared in this scope string code = findCode(matrix, c); ^ adfgx.cpp:35:24: error: 'key' was not declared in this scope string sortedKey = key; ^ adfgx.cpp:36:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < sortedKey.size() - 1; i++) { ^ adfgx.cpp:37:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = i + 1; j < sortedKey.size(); j++) { ^ adfgx.cpp:45:33: error: unable to deduce 'auto&&' from 'codes' for (const auto& code : codes) { ^ adfgx.cpp: In function 'std::string decrypt(char (*)[5], std::string, std::string)': adfgx.cpp:59:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < key.length(); ++i) { ^ adfgx.cpp:64:32: error: 'sort' was not declared in this scope sort(key.begin(), key.end()); ^ adfgx.cpp:76:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < decrypted.length(); i += 2) { ^ adfgx.cpp: In function 'int main()': adfgx.cpp:102:56: error: invalid conversion from 'char (*)[5]' to 'int' [-fpermissive] string encrypted = encrypt(matrix, key, message); ^ adfgx.cpp:102:56: error: too many arguments to function 'std::string encrypt(int)' adfgx.cpp:26:8: note: declared here string encrypt(const vector<vector<char>>& matrix, const string& key, const string& message) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema adfgx 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ă.