#4296
Se dă un șir de n
numere naturale nenule și de asemenea un număr natural p
. Să se calculeze suma numerelor din șir care au cel puțin p
divizori.
Problema | SumDiv | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57108595 | Utilizator | |
Fișier | sumdiv.cpp | Dimensiune | 575 B |
Data încărcării | 17 Martie 2025, 07:58 | Scor / rezultat | Eroare de compilare |
sumdiv.cpp:17:1: error: stray '\342' in program for (i=2; i‹=n; i++) ^ sumdiv.cpp:17:1: error: stray '\200' in program sumdiv.cpp:17:1: error: stray '\271' in program sumdiv.cpp:27:2: error: stray '\342' in program for (d=2; d*d<=p-›inf; d++) ^ sumdiv.cpp:27:2: error: stray '\200' in program sumdiv.cpp:27:2: error: stray '\272' in program sumdiv.cpp:28:4: error: stray '\342' in program {if (p-›inf%d==0) ^ sumdiv.cpp:28:4: error: stray '\200' in program sumdiv.cpp:28:4: error: stray '\272' in program sumdiv.cpp:29:6: error: stray '\342' in program {if (d*d!=p-›inf) ^ sumdiv.cpp:29:6: error: stray '\200' in program sumdiv.cpp:29:6: error: stray '\272' in program sumdiv.cpp:32:7: error: stray '\342' in program if (nr›=div) ^ sumdiv.cpp:32:7: error: stray '\200' in program sumdiv.cpp:32:7: error: stray '\272' in program sumdiv.cpp: In function 'int main()': sumdiv.cpp:17:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] for (i=2; i‹=n; i++) ^ sumdiv.cpp:27:22: error: 'inf' was not declared in this scope for (d=2; d*d<=p-›inf; d++) ^ sumdiv.cpp:32:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (nr›=div) ^ sumdiv.cpp:10:16: warning: unused variable 'j' [-Wunused-variable] int n, div, i, j, nr, d, S=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumDiv 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ă.