#4330
Se dă un număr natural n. Calculați suma dintre cei mai mici doi divizori proprii ai lui n.
| Problema | Divizori7 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63455035 | Utilizator | |
| Fișier | divizori7.cpp | Dimensiune | 229 B |
| Data încărcării | 04 Martie 2026, 10:29 | Scor/rezultat | Eroare de compilare |
divizori7.cpp: In function 'int main()': divizori7.cpp:9:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(d=2, d<=n-1, && ct<2, d++) ^ divizori7.cpp:9:11: warning: right operand of comma operator has no effect [-Wunused-value] for(d=2, d<=n-1, && ct<2, d++) ^ divizori7.cpp:9:24: warning: right operand of comma operator has no effect [-Wunused-value] for(d=2, d<=n-1, && ct<2, d++) ^ divizori7.cpp:9:31: error: expected ';' before ')' token for(d=2, d<=n-1, && ct<2, d++) ^ divizori7.cpp:20:1: error: expected primary-expression at end of input } ^ divizori7.cpp:20:1: error: expected ';' at end of input divizori7.cpp:20:1: error: expected primary-expression at end of input divizori7.cpp:20:1: error: expected ')' at end of input divizori7.cpp:20:1: error: expected statement at end of input divizori7.cpp:7:13: warning: unused variable 's' [-Wunused-variable] int n,d,s=0,ct=0; ^ divizori7.cpp:7:17: warning: unused variable 'ct' [-Wunused-variable] int n,d,s=0,ct=0; ^ divizori7.cpp:20:1: error: expected '}' at end of input } ^ divizori7.cpp:9:22: error: label 'ct' used but not defined for(d=2, d<=n-1, && ct<2, d++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Divizori7 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ă.