#2608
biprime
Se dă n
un număr natural care este produsul a două numere prime distincte, şi m
reprezentând numărul numerelor mai mici sau egale cu n
, prime cu n
. Aflaţi cele două numere prime din descompunerea lui n
.
Problema | biprime | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54846816 | Utilizator | |
Fișier | biprime.cpp | Dimensiune | 475 B |
Data încărcării | 10 Decembrie 2024, 10:54 | Scor / rezultat | Eroare de compilare |
biprime.cpp:1:1: error: 'iusing' does not name a type iusing namespace std; ^ biprime.cpp: In function 'int main()': biprime.cpp:8:19: error: 'ifstream' was not declared in this scope ifstream("cin") ^ biprime.cpp:8:19: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from biprime.cpp:2: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ biprime.cpp:9:5: error: expected ';' before 'ofstream' ofstream("cout") ^ biprime.cpp:11:5: error: 'cin' was not declared in this scope cin>>n>>c; ^ biprime.cpp:11:5: note: suggested alternative: In file included from biprime.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ biprime.cpp:11:10: error: 'n' was not declared in this scope cin>>n>>c; ^ biprime.cpp:11:13: error: 'c' was not declared in this scope cin>>n>>c; ^ biprime.cpp:14:14: error: 'a' was not declared in this scope cin>>a; ^ biprime.cpp:15:9: error: 'ca' was not declared in this scope ca=a; ^ biprime.cpp:16:22: error: 'd' was not declared in this scope while(a>1 && d*d<=0) ^ biprime.cpp:17:10: error: 'exp' was not declared in this scope {exp++;a=a/d;} ^ biprime.cpp:18:9: error: 'nrdiv' was not declared in this scope nrdiv=nrdiv*(exp+1); ^ biprime.cpp:18:22: error: 'exp' was not declared in this scope nrdiv=nrdiv*(exp+1); ^ biprime.cpp:20:9: error: 'd' was not declared in this scope d++; ^ biprime.cpp:24:5: error: 'a' was not declared in this scope if(a>1) nrdiv*=2; ^ biprime.cpp:24:10: error: 'nrdiv' was not declared in this scope if(a>1) nrdiv*=2; ^ biprime.cpp:25:5: error: 'nrdiv' was not declared in this scope if(nrdiv>=c) ^ biprime.cpp:26:2: error: 'cout' was not declared in this scope cout<ca<<" "; ^ biprime.cpp:26:2: note: suggested alternative: In file included from biprime.cpp:2:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ biprime.cpp:26:7: error: 'ca' was not declared in this scope cout<ca<<" "; ^ biprime.cpp:27:2: error: 'nrdiv' was not declared in this scope nrdiv=1; ^ biprime.cpp:28:2: error: 'exp' was not declared in this scope exp=0; ^ biprime.cpp:29:2: error: 'd' was not declared in this scope d=2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema biprime 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ă.