#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 | #64294413 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 1.27 KB |
| Data încărcării | 28 Aprilie 2026, 12:37 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:6:1: error: ‘ofstrem’ does not name a type 6 | ofstrem out("aranjamente.out"); | ^~~~~~~ aranjamente.cpp: In function ‘void Afis(int)’: aranjamente.cpp:12:9: error: ‘out’ was not declared in this scope 12 | out << x[j] << " "; | ^~~ aranjamente.cpp:13:5: error: ‘out’ was not declared in this scope 13 | out << endl; | ^~~ aranjamente.cpp: In function ‘void Back(int)’: aranjamente.cpp:32:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 32 | if(OK(k)) | ^ aranjamente.cpp: At global scope: aranjamente.cpp:44:5: error: redefinition of ‘int x [10]’ 44 | int x[10] , n , p; | ^ aranjamente.cpp:7:5: note: ‘int x [10]’ previously declared here 7 | int x[10] , n , p; | ^ aranjamente.cpp:44:13: error: redefinition of ‘int n’ 44 | int x[10] , n , p; | ^ aranjamente.cpp:7:13: note: ‘int n’ previously declared here 7 | int x[10] , n , p; | ^ aranjamente.cpp:44:17: error: redefinition of ‘int p’ 44 | int x[10] , n , p; | ^ aranjamente.cpp:7:17: note: ‘int p’ previously declared here 7 | int x[10] , n , p; | ^ aranjamente.cpp:46:6: error: redefinition of ‘void Afis(int)’ 46 | void Afis(int k) | ^~~~ aranjamente.cpp:9:6: note: ‘void Afis(int)’ previously defined here 9 | void Afis(int k) | ^~~~ aranjamente.cpp: In function ‘void Afis(int)’: aranjamente.cpp:49:9: error: ‘out’ was not declared in this scope 49 | out << x[j] << " "; | ^~~ aranjamente.cpp:50:5: error: ‘out’ was not declared in this scope 50 | out << endl; | ^~~ aranjamente.cpp: At global scope: aranjamente.cpp:53:6: error: redefinition of ‘bool OK(int)’ 53 | bool OK(int k){ | ^~ aranjamente.cpp:16:6: note: ‘bool OK(int)’ previously defined here 16 | bool OK(int k){ | ^~ aranjamente.cpp:60:6: error: redefinition of ‘bool Solutie(int)’ 60 | bool Solutie(int k) | ^~~~~~~ aranjamente.cpp:23:6: note: ‘bool Solutie(int)’ previously defined here 23 | bool Solutie(int k) | ^~~~~~~ aranjamente.cpp:65:6: error: redefinition of ‘void Back(int)’ 65 | void Back(int k){ | ^~~~ aranjamente.cpp:28:6: note: ‘void Back(int)’ previously defined here 28 | void Back(int k){ | ^~~~ aranjamente.cpp: In function ‘void Back(int)’: aranjamente.cpp:69:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 69 | if(OK(k)) | ^ aranjamente.cpp: At global scope: aranjamente.cpp:76:5: error: redefinition of ‘int main()’ 76 | int main(){ | ^~~~ aranjamente.cpp:39:5: note: ‘int main()’ previously defined here 39 | 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ă.