#1583
Se citesc de la tastatură n numere naturale. Să se determine numarul de numere prime formate din ultimele 2 cifre ale fiecarui număr.
| Problema | 2prim | Operații I/O |
2prim.in/2prim.out
|
|---|---|---|---|
| Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64309449 | Utilizator | |
| Fișier | prim.cpp | Dimensiune | 435 B |
| Data încărcării | 29 Aprilie 2026, 08:37 | Scor/rezultat | Eroare de compilare |
prim.cpp:5:5: error: expected ‘,’ or ‘;’ before ‘ofstream’ 5 | ofstream g("2prim.out") | ^~~~~~~~ prim.cpp: In function ‘int prim(int)’: prim.cpp:10:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(d=2;d*d<=x;d++) | ^~~ prim.cpp:13:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | if(x<2) | ^~ prim.cpp: In function ‘int main()’: prim.cpp:17:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 17 | {int main() | ^~ prim.cpp:17:10: note: remove parentheses to default-initialize a variable 17 | {int main() | ^~ | -- prim.cpp:17:10: note: or replace parentheses with braces to value-initialize a variable prim.cpp:18:1: error: a function-definition is not allowed here before ‘{’ token 18 | {fin>>n; | ^ prim.cpp:28:2: error: expected ‘}’ at end of input 28 | } | ^ prim.cpp:17:1: note: to match this ‘{’ 17 | {int main() | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema 2prim 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ă.