#202
PermPF
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine lexicografică, permutările fără puncte fixe ale mulţimii {1,2,..,n}
.
Problema | PermPF | Operații I/O |
permpf.in /permpf.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52552355 | Utilizator | |
Fișier | permpf.cpp | Dimensiune | 393 B |
Data încărcării | 03 Octombrie 2024, 08:21 | Scor / rezultat | Eroare de compilare |
permpf.cpp: In function 'bool valid(int)': permpf.cpp:6:9: error: 'cout' was not declared in this scope cout<<st[i]<<' '; ^ permpf.cpp:6:9: note: suggested alternative: In file included from permpf.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ permpf.cpp:6:15: error: 'st' was not declared in this scope cout<<st[i]<<' '; ^ permpf.cpp:7:9: error: 'cout' was not declared in this scope cout<<st[p]<<endl; ^ permpf.cpp:7:9: note: suggested alternative: In file included from permpf.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ permpf.cpp:7:15: error: 'st' was not declared in this scope cout<<st[p]<<endl; ^ permpf.cpp:7:22: error: 'endl' was not declared in this scope cout<<st[p]<<endl; ^ permpf.cpp:7:22: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from permpf.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ permpf.cpp:8:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ permpf.cpp: In function 'void bkt(int)': permpf.cpp:12:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ permpf.cpp:14:9: error: 'st' was not declared in this scope st[p]=i; ^ permpf.cpp:17:29: error: 'tipar' was not declared in this scope if(p==n) tipar(p); ^ permpf.cpp:19:9: error: expected ';' before '}' token } ^ permpf.cpp: In function 'int main()': permpf.cpp:26:5: error: 'cin' was not declared in this scope cin>>n; ^ permpf.cpp:26:5: note: suggested alternative: In file included from permpf.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PermPF 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ă.