#124
Permutari1
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine invers lexicografică, permutările mulţimii {1,2,..,n}
.
Problema | Permutari1 | Operații I/O |
permutari1.in /permutari1.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #32234661 | Utilizator | |
Fișier | permutari1.cpp | Dimensiune | 793 B |
Data încărcării | 10 Noiembrie 2021, 10:21 | Scor / rezultat | Eroare de compilare |
permutari1.cpp:5:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("permutari.in"); ^ permutari1.cpp:6:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("permutari.out"); ^ permutari1.cpp: In function 'void afisare()': permutari1.cpp:12:9: error: reference to 'cout' is ambiguous cout << list[i] << " "; ^ permutari1.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("permutari.out"); ^ In file included from permutari1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ permutari1.cpp:13:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ permutari1.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("permutari.out"); ^ In file included from permutari1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ permutari1.cpp: In function 'void bkt(int)': permutari1.cpp:32:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (valid(lungime)) ^ permutari1.cpp: In function 'int main()': permutari1.cpp:42:5: error: reference to 'cout' is ambiguous cout << "n = "; cin >> n; ^ permutari1.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("permutari.out"); ^ In file included from permutari1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ permutari1.cpp:42:21: error: reference to 'cin' is ambiguous cout << "n = "; cin >> n; ^ permutari1.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("permutari.in"); ^ In file included from permutari1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari1 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ă.