#123
Permutari
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine lexicografică, permutările mulţimii {1,2,..,n}
.
Problema | Permutari | Operații I/O |
permutari.in /permutari.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52465195 | Utilizator | |
Fișier | permutari.cpp | Dimensiune | 764 B |
Data încărcării | 30 Septembrie 2024, 22:19 | Scor / rezultat | Eroare de compilare |
permutari.cpp: In function 'void afis(int, int*, int&, int*)': permutari.cpp:11:20: error: reference to 'cout' is ambiguous if(x[i]==1)cout<<a[i]<<' '; ^ permutari.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("permutari.out"); ^ In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ permutari.cpp:13:5: error: reference to 'cout' is ambiguous cout<<'\n'; ^ permutari.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("permutari.out"); ^ In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ permutari.cpp: In function 'int main()': permutari.cpp:19:5: error: reference to 'cin' is ambiguous cin>>n; ^ permutari.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("permutari.in"); ^ In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ permutari.cpp:20:30: error: reference to 'cin' is ambiguous for(int i=1 ;i <=n; i++) cin>>a[i]; ^ permutari.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("permutari.in"); ^ In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ permutari.cpp:43:9: error: reference to 'cout' is ambiguous cout<<cnt; ^ permutari.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("permutari.out"); ^ In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari 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ă.