#197
Combinari
Se citesc două numere naturale nenule n
și k
. Să se afişeze, în ordine lexicografică, submulțimile de câte k
elemente ale mulţimii {1,2,..,n}
.
Problema | Combinari | Operații I/O |
combinari.in /combinari.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45082264 | Utilizator | |
Fișier | combinari.cpp | Dimensiune | 553 B |
Data încărcării | 02 Octombrie 2023, 12:59 | Scor / rezultat | Eroare de compilare |
combinari.cpp:6:15: warning: missing terminating " character [enabled by default] ofstream cout("combinari.out); ^ combinari.cpp:6:1: error: missing terminating " character ofstream cout("combinari.out); ^ combinari.cpp:7:7: error: 'p' has not been declared int m,p,x[100]; ^ combinari.cpp:7:9: error: 'x' has not been declared int m,p,x[100]; ^ combinari.cpp:7:15: error: expected ')' before ';' token int m,p,x[100]; ^ combinari.cpp: In function 'void tipar()': combinari.cpp:19:20: error: 'p' was not declared in this scope for(int i=0;i<=p;i++) ^ combinari.cpp:20:9: error: reference to 'cout' is ambiguous cout<<x[i]<<" "; ^ combinari.cpp:6:10: note: candidates are: std::ofstream cout(int, int, int*) ofstream cout("combinari.out); ^ In file included from combinari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ combinari.cpp:20:15: error: 'x' was not declared in this scope cout<<x[i]<<" "; ^ combinari.cpp:21:5: error: reference to 'cout' is ambiguous cout<<endl; ^ combinari.cpp:6:10: note: candidates are: std::ofstream cout(int, int, int*) ofstream cout("combinari.out); ^ In file included from combinari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ combinari.cpp: In function 'void BKT(int)': combinari.cpp:26:11: error: 'p' was not declared in this scope if(k==p+1) ^ combinari.cpp:28:15: error: 'x' was not declared in this scope for(int i=x[k-1]=1; i<=n; i++) ^ combinari.cpp:28:28: error: 'n' was not declared in this scope for(int i=x[k-1]=1; i<=n; i++) ^ combinari.cpp: In function 'int main()': combinari.cpp:38:3: error: reference to 'cin' is ambiguous cin>>n>>p; ^ combinari.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("combinari.in"); ^ In file included from combinari.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ combinari.cpp:38:8: error: 'n' was not declared in this scope cin>>n>>p; ^ combinari.cpp:38:11: error: 'p' was not declared in this scope cin>>n>>p; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Combinari 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ă.