#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 | #52073279 | Utilizator | |
Fișier | sirpie.cpp | Dimensiune | 888 B |
Data încărcării | 18 Septembrie 2024, 11:37 | Scor / rezultat | Eroare de compilare |
sirpie.cpp: In function 'void Afisare()': sirpie.cpp:3:27: error: 'n' was not declared in this scope for (int i = 1 ; i <= n ; i ++) ^ sirpie.cpp:4:9: error: 'fout' was not declared in this scope fout << v[x[i]] << " "; ^ sirpie.cpp:4:17: error: 'v' was not declared in this scope fout << v[x[i]] << " "; ^ sirpie.cpp:4:19: error: 'x' was not declared in this scope fout << v[x[i]] << " "; ^ sirpie.cpp:5:5: error: 'fout' was not declared in this scope fout << endl; ^ sirpie.cpp:5:13: error: 'endl' was not declared in this scope fout << endl; ^ sirpie.cpp: In function 'bool OK(int)': sirpie.cpp:11:12: error: 'x' was not declared in this scope if(x[i] == x[k]) ^ sirpie.cpp:14:18: error: 'v' was not declared in this scope if(cmmdc(v[x[k]], v[x[k-1]]) != 1) ^ sirpie.cpp:14:20: error: 'x' was not declared in this scope if(cmmdc(v[x[k]], v[x[k-1]]) != 1) ^ sirpie.cpp:14:36: error: 'cmmdc' was not declared in this scope if(cmmdc(v[x[k]], v[x[k-1]]) != 1) ^ sirpie.cpp: In function 'void back(int)': sirpie.cpp:21:25: error: 'n' was not declared in this scope for(int i =1 ; i <= n ; i ++) ^ sirpie.cpp:23:9: error: 'x' was not declared in this scope x[k] = i; ^ sirpie.cpp:24:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(OK(k)) ^ sirpie.cpp: In function 'int main()': sirpie.cpp:34:5: error: 'fin' was not declared in this scope fin >> n; ^ sirpie.cpp:34:12: error: 'n' was not declared in this scope fin >> n; ^ sirpie.cpp:36:16: error: 'v' was not declared in this scope fin >> v[i]; ^ sirpie.cpp:39:16: error: 'v' was not declared in this scope if(v[i] > v[j]) ^
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ă.