#196
Aranjamente
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 | #21277184 | Utilizator | |
Fișier | aranjamente.cpp | Dimensiune | 784 B |
Data încărcării | 25 Februarie 2020, 15:43 | Scor / rezultat | Eroare de compilare |
aranjamente.cpp:6:5: error: expected ',' or ';' before 'ofstream' ofstream scrie("aranjamente.out") ^ aranjamente.cpp: In function 'int valid(int)': aranjamente.cpp:14:12: error: 'x' was not declared in this scope if(x[i]==x[k]) return 0; ^ aranjamente.cpp: In function 'void Afisare(int)': aranjamente.cpp:22:5: error: 'scrie' was not declared in this scope scrie<<x[i]<<" "; ^ aranjamente.cpp:22:12: error: 'x' was not declared in this scope scrie<<x[i]<<" "; ^ aranjamente.cpp:23:5: error: 'scrie' was not declared in this scope scrie<<endl; ^ aranjamente.cpp: In function 'void Back(int)': aranjamente.cpp:27:25: error: 'n' was not declared in this scope for(int i = 1 ; i <=n ; ++i) ^ aranjamente.cpp:29:9: error: 'x' was not declared in this scope x[k]=i; ^ aranjamente.cpp:31:19: error: 'p' was not declared in this scope if(k==p) ^ aranjamente.cpp:30:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if( valid(k) ) ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:39:14: error: 'n' was not declared in this scope citeste>>n; ^ aranjamente.cpp:40:14: error: 'p' was not declared in this scope citeste>>p; ^
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ă.