#196
Se citesc două numere naturale nenule n și k. Să se afişeze, în ordine lexicografică, aranjamentele de câte k elemente ale mulţimii {1,2,..,n}.
| Problema | Aranjamente | Operații I/O |
aranjamente.in/aranjamente.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64294318 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 1.25 KB |
| Data încărcării | 28 Aprilie 2026, 12:36 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:5:1: error: ‘ofstrem’ does not name a type 5 | ofstrem out("aranjamente.out"); | ^~~~~~~ aranjamente.cpp: In function ‘void Afis(int)’: aranjamente.cpp:11:9: error: ‘out’ was not declared in this scope 11 | out << x[j] << " "; | ^~~ aranjamente.cpp:12:5: error: ‘out’ was not declared in this scope 12 | out << endl; | ^~~ aranjamente.cpp: In function ‘void Back(int)’: aranjamente.cpp:31:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 31 | if(OK(k)) | ^ aranjamente.cpp: At global scope: aranjamente.cpp:43:5: error: redefinition of ‘int x [10]’ 43 | int x[10] , n , p; | ^ aranjamente.cpp:6:5: note: ‘int x [10]’ previously declared here 6 | int x[10] , n , p; | ^ aranjamente.cpp:43:13: error: redefinition of ‘int n’ 43 | int x[10] , n , p; | ^ aranjamente.cpp:6:13: note: ‘int n’ previously declared here 6 | int x[10] , n , p; | ^ aranjamente.cpp:43:17: error: redefinition of ‘int p’ 43 | int x[10] , n , p; | ^ aranjamente.cpp:6:17: note: ‘int p’ previously declared here 6 | int x[10] , n , p; | ^ aranjamente.cpp:45:6: error: redefinition of ‘void Afis(int)’ 45 | void Afis(int k) | ^~~~ aranjamente.cpp:8:6: note: ‘void Afis(int)’ previously defined here 8 | void Afis(int k) | ^~~~ aranjamente.cpp: In function ‘void Afis(int)’: aranjamente.cpp:48:9: error: ‘out’ was not declared in this scope 48 | out << x[j] << " "; | ^~~ aranjamente.cpp:49:5: error: ‘out’ was not declared in this scope 49 | out << endl; | ^~~ aranjamente.cpp: At global scope: aranjamente.cpp:52:6: error: redefinition of ‘bool OK(int)’ 52 | bool OK(int k){ | ^~ aranjamente.cpp:15:6: note: ‘bool OK(int)’ previously defined here 15 | bool OK(int k){ | ^~ aranjamente.cpp:59:6: error: redefinition of ‘bool Solutie(int)’ 59 | bool Solutie(int k) | ^~~~~~~ aranjamente.cpp:22:6: note: ‘bool Solutie(int)’ previously defined here 22 | bool Solutie(int k) | ^~~~~~~ aranjamente.cpp:64:6: error: redefinition of ‘void Back(int)’ 64 | void Back(int k){ | ^~~~ aranjamente.cpp:27:6: note: ‘void Back(int)’ previously defined here 27 | void Back(int k){ | ^~~~ aranjamente.cpp: In function ‘void Back(int)’: aranjamente.cpp:68:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 68 | if(OK(k)) | ^ aranjamente.cpp: At global scope: aranjamente.cpp:75:5: error: redefinition of ‘int main()’ 75 | int main(){ | ^~~~ aranjamente.cpp:38:5: note: ‘int main()’ previously defined here 38 | int main(){ | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Aranjamente 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ă.