#3154
Se citește de la tastatură un cuvânt s format din cel mult 11 litere mici distincte. Să se genereze în ordine alfabetică și să se afișeze toate anagramele cuvântului s în care vocalele sunt puncte fixe.
| Problema | anagrame_pfv | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64369081 | Utilizator | |
| Fișier | anagrame_pfv.cpp | Dimensiune | 1.34 KB |
| Data încărcării | 04 Mai 2026, 08:14 | Scor/rezultat | Eroare de compilare |
anagrame_pfv.cpp:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>#include <cstring>#include <algorithm>using namespace std;char cuv[12];int s[12], n, viz[12], nr;bool verif(char c) | ^ anagrame_pfv.cpp:3:1: error: expected unqualified-id before ‘{’ token 3 | { | ^ anagrame_pfv.cpp: In function ‘void backtr(int)’: anagrame_pfv.cpp:15:14: error: ‘n’ was not declared in this scope 15 | if (i == n) | ^ anagrame_pfv.cpp:21:17: error: ‘viz’ was not declared in this scope 21 | if (viz[j] == 2) | ^~~ anagrame_pfv.cpp:23:17: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 23 | cout << cuv[j]; | ^~~~ | std::cout In file included from anagrame_pfv.cpp:1: /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ anagrame_pfv.cpp:23:25: error: ‘cuv’ was not declared in this scope 23 | cout << cuv[j]; | ^~~ anagrame_pfv.cpp:25:33: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 25 | else cout << cuv[s[j]]; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ anagrame_pfv.cpp:25:41: error: ‘cuv’ was not declared in this scope 25 | else cout << cuv[s[j]]; | ^~~ anagrame_pfv.cpp:25:45: error: ‘s’ was not declared in this scope 25 | else cout << cuv[s[j]]; | ^ anagrame_pfv.cpp:27:9: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 27 | cout << '\n'; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ anagrame_pfv.cpp:33:13: error: ‘viz’ was not declared in this scope 33 | if (viz[i] == 2) | ^~~ anagrame_pfv.cpp:37:13: error: ‘s’ was not declared in this scope 37 | s[i] = i; | ^ anagrame_pfv.cpp:49:17: error: ‘s’ was not declared in this scope 49 | s[i] = j; | ^ anagrame_pfv.cpp: In function ‘int main()’: anagrame_pfv.cpp:65:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 65 | cin >> cuv; | ^~~ | std::cin /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ anagrame_pfv.cpp:65:12: error: ‘cuv’ was not declared in this scope 65 | cin >> cuv; | ^~~ anagrame_pfv.cpp:67:5: error: ‘n’ was not declared in this scope 67 | n = strlen(cuv); | ^ anagrame_pfv.cpp:67:9: error: ‘strlen’ was not declared in this scope 67 | n = strlen(cuv); | ^~~~~~ anagrame_pfv.cpp:2:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? 1 | #include <iostream>#include <cstring>#include <algorithm>using namespace std;char cuv[12];int s[12], n, viz[12], nr;bool verif(char c) +++ |+#include <cstring> 2 | anagrame_pfv.cpp:71:13: error: ‘verif’ was not declared in this scope; did you mean ‘vprintf’? 71 | if (verif(cuv[i])) { | ^~~~~ | vprintf anagrame_pfv.cpp:73:13: error: ‘viz’ was not declared in this scope 73 | viz[i] = 2; | ^~~ anagrame_pfv.cpp:75:13: error: ‘s’ was not declared in this scope 75 | s[i] = i; | ^ anagrame_pfv.cpp:77:13: error: ‘nr’ was not declared in this scope 77 | nr++; | ^~ anagrame_pfv.cpp:85:36: error: ‘viz’ was not declared in this scope 85 | if (cuv[i] > cuv[j] && viz[i] != 2 && viz[j] != 2) { | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema anagrame_pfv 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ă.