#1327
SirPIE
Se citeşte un număr natural nenul n
, apoi n
numere naturale distincte. Să se afişeze, în ordine lexicografică, șirurile din cele n
valori cu proprietatea că oricare două valori învecinate sunt prime între ele.
Problema | SirPIE | Operații I/O |
sirpie.in /sirpie.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #11049434 | Utilizator | |
Fișier | sirpie.cpp | Dimensiune | 860 B |
Data încărcării | 16 Octombrie 2018, 13:17 | Scor / rezultat | Eroare de compilare |
sirpie.cpp:1:1: error: 'include' does not name a type include include ^ sirpie.cpp:4:1: error: 'ifstream' does not name a type ifstream fin("sirpie.in"); ^ sirpie.cpp:5:1: error: 'ofstream' does not name a type ofstream fout("sirpie.out"); ^ sirpie.cpp: In function 'void afisare()': sirpie.cpp:12:1: error: 'fout' was not declared in this scope fout<=z)w=w%z; ^ sirpie.cpp:12:7: error: 'z' was not declared in this scope fout<=z)w=w%z; ^ sirpie.cpp:12:8: error: expected ';' before ')' token fout<=z)w=w%z; ^ sirpie.cpp:13:1: error: 'else' without a previous 'if' else z=z%w; ^ sirpie.cpp:13:6: error: 'z' was not declared in this scope else z=z%w; ^ sirpie.cpp:13:10: error: 'w' was not declared in this scope else z=z%w; ^ sirpie.cpp:14:12: error: return-statement with a value, in function returning 'void' [-fpermissive] return (z+w); ^ sirpie.cpp: In function 'int verif(int)': sirpie.cpp:19:1: error: expected primary-expression before 'for' for(int i=1;i<=n;i++) fin>>a[i]; ^ sirpie.cpp:19:1: error: expected ')' before 'for' sirpie.cpp:19:23: error: 'fin' was not declared in this scope for(int i=1;i<=n;i++) fin>>a[i]; ^ sirpie.cpp:20:15: error: 'sort' was not declared in this scope sort(a+1,a+n+1); ^ sirpie.cpp:21:7: error: 'back' was not declared in this scope back(1); ^ sirpie.cpp: In function 'void afisare()': sirpie.cpp:24:11: error: redefinition of 'void afisare()' void afisare() ^ sirpie.cpp:10:6: error: 'void afisare()' previously defined here void afisare () ^ sirpie.cpp:28:9: error: 'out' was not declared in this scope out<<v[st[i]]<<" "; ^ sirpie.cpp:28:14: error: 'v' was not declared in this scope out<<v[st[i]]<<" "; ^ sirpie.cpp:28:16: error: 'st' was not declared in this scope out<<v[st[i]]<<" "; ^ sirpie.cpp:29:5: error: 'out' was not declared in this scope out<<endl; ^ sirpie.cpp:29:10: error: 'endl' was not declared in this scope out<<endl; ^ sirpie.cpp: In function 'void bkt(int)': sirpie.cpp:39:16: error: 'st' was not declared in this scope st[k]=i; ^ sirpie.cpp:40:26: error: 'valid' was not declared in this scope if(valid(k)==1) ^ sirpie.cpp: In function 'int main()': sirpie.cpp:50:5: error: 'in' was not declared in this scope in>>n; ^ sirpie.cpp:52:13: error: 'v' was not declared in this scope in>>v[i]; ^ sirpie.cpp:53:12: error: 'v' was not declared in this scope sort(v+1,v+n+1); ^ sirpie.cpp:53:21: error: 'sort' was not declared in this scope sort(v+1,v+n+1); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SirPIE 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ă.