#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 | #55088637 | Utilizator | |
Fișier | sirpie.cpp | Dimensiune | 874 B |
Data încărcării | 21 Decembrie 2024, 23:09 | Scor / rezultat | Eroare de compilare |
sirpie.cpp:5:15: warning: missing terminating " character [enabled by default] ofstream cout("sirpie.out ^ sirpie.cpp:5:1: error: missing terminating " character ofstream cout("sirpie.out ^ sirpie.cpp:6:7: error: 'x' has not been declared int n,x[15],s[15]; ^ sirpie.cpp:6:13: error: 's' has not been declared int n,x[15],s[15]; ^ sirpie.cpp:6:18: error: expected ')' before ';' token int n,x[15],s[15]; ^ sirpie.cpp: In function 'void afis()': sirpie.cpp:20:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ sirpie.cpp:21:15: error: 's' was not declared in this scope cout<<s[i]<<" "; ^ sirpie.cpp:22:11: error: invalid operands of types 'std::ofstream(int, int*, int*) {aka std::basic_ofstream<char>(int, int*, int*)}' and 'char' to binary 'operator<<' cout<<'\n'; ^ sirpie.cpp: In function 'bool OK(int)': sirpie.cpp:26:12: error: 's' was not declared in this scope if(s[i]==s[k]) ^ sirpie.cpp: In function 'void bak(int)': sirpie.cpp:32:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++){ ^ sirpie.cpp:33:9: error: 's' was not declared in this scope s[k]=x[i]; ^ sirpie.cpp:33:14: error: 'x' was not declared in this scope s[k]=x[i]; ^ sirpie.cpp:35:28: error: 't2' was not declared in this scope if(k==1||(cmmdc(t1,t2) && OK(k))){ ^ sirpie.cpp: In function 'int main()': sirpie.cpp:43:10: error: 'n' was not declared in this scope cin>>n; ^ sirpie.cpp:45:14: error: 'x' was not declared in this scope cin>>x[i]; ^ sirpie.cpp:46:10: error: 'x' was not declared in this scope sort(x+1,x+1+n); ^
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ă.