#1408
Numere10
Se dau n
numere naturale. Calculați câte dintre ele sunt prime, cel mai mare și cel mai mic număr prim.
Problema | Numere10 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55064902 | Utilizator | |
Fișier | numere10.cpp | Dimensiune | 615 B |
Data încărcării | 19 Decembrie 2024, 18:57 | Scor / rezultat | Eroare de compilare |
numere10.cpp:2:7: error: expected nested-name-specifier before 'namespce' using namespce std; ^ numere10.cpp:2:7: error: 'namespce' has not been declared numere10.cpp:2:16: error: expected ';' before 'std' using namespce std; ^ numere10.cpp:2:16: error: 'std' does not name a type numere10.cpp: In function 'int main()': numere10.cpp:6:29: error: expected ',' or ';' before 'minim' int n, prim=0, maxim=0. minim=10000000, cnt=0, a, b; ^ numere10.cpp:7:5: error: 'cin' was not declared in this scope cin>n; ^ numere10.cpp:7:5: note: suggested alternative: In file included from numere10.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ numere10.cpp:12:8: error: 'a' was not declared in this scope if(a > b) { ^ numere10.cpp:12:12: error: 'b' was not declared in this scope if(a > b) { ^ numere10.cpp:17:17: error: 'a' was not declared in this scope for(int i = a; i <= b; ++i) { ^ numere10.cpp:17:25: error: 'b' was not declared in this scope for(int i = a; i <= b; ++i) { ^ numere10.cpp:28:15: error: 'cnt' was not declared in this scope ++cnt; ^ numere10.cpp:31:5: error: 'cout' was not declared in this scope cout << cnt; ^ numere10.cpp:31:5: note: suggested alternative: In file included from numere10.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ numere10.cpp:31:13: error: 'cnt' was not declared in this scope cout << cnt; ^ numere10.cpp:6:12: warning: unused variable 'prim' [-Wunused-variable] int n, prim=0, maxim=0. minim=10000000, cnt=0, a, b; ^ numere10.cpp:6:20: warning: unused variable 'maxim' [-Wunused-variable] int n, prim=0, maxim=0. minim=10000000, cnt=0, a, b; ^ numere10.cpp:33:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere10 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ă.