#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 | #58161588 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 658 B |
| Data încărcării | 17 Mai 2025, 15:01 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream fout("aranjamente.out") ^ aranjamente.cpp: In function 'bool valid(int)': aranjamente.cpp:10:12: error: 'x' was not declared in this scope if(x[i]==x[k]) ^ aranjamente.cpp: In function 'void afis()': aranjamente.cpp:18:21: error: 'a' was not declared in this scope for(int i=1; i<=a; i++) ^ aranjamente.cpp:20:9: error: 'fout' was not declared in this scope fout<<x[i]; ^ aranjamente.cpp:20:15: error: 'x' was not declared in this scope fout<<x[i]; ^ aranjamente.cpp:22:5: error: 'fout' was not declared in this scope fout<<" "; ^ aranjamente.cpp: In function 'void bkt(int)': aranjamente.cpp:28:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ aranjamente.cpp:30:9: error: 'x' was not declared in this scope x[k]=i; ^ aranjamente.cpp:33:19: error: 'a' was not declared in this scope if(k==a) ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:45:12: error: 'n' was not declared in this scope fin >> n >> a; ^ aranjamente.cpp:45:17: error: 'a' was not declared in this scope fin >> n >> a; ^ aranjamente.cpp:44:9: warning: unused variable 'k' [-Wunused-variable] int k; ^
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ă.