#16
Suma divizorilor
C++
Să se scrie o funcție C++ care să determine suma divizorilor unui număr natural transmis ca parametru. Funcția va returna rezultatul.
Problema | Suma divizorilor | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #13799877 | Utilizator | |
Fișier | suma_divizorilor.cpp | Dimensiune | 312 B |
Data încărcării | 10 Februarie 2019, 14:39 | Scor / rezultat | Eroare de compilare |
suma_divizorilor.cpp:10:1: error: stray '\302' in program int s = 0, i; ^ suma_divizorilor.cpp:10:1: error: stray '\240' in program suma_divizorilor.cpp:10:1: error: stray '\302' in program suma_divizorilor.cpp:10:1: error: stray '\240' in program suma_divizorilor.cpp:10:1: error: stray '\302' in program suma_divizorilor.cpp:10:1: error: stray '\240' in program suma_divizorilor.cpp:11:1: error: stray '\302' in program for (i = 1; i * i < n; i++) ^ suma_divizorilor.cpp:11:1: error: stray '\240' in program suma_divizorilor.cpp:11:1: error: stray '\302' in program suma_divizorilor.cpp:11:1: error: stray '\240' in program suma_divizorilor.cpp:11:1: error: stray '\302' in program suma_divizorilor.cpp:11:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program if (n % i == 0) ^ suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:12:1: error: stray '\302' in program suma_divizorilor.cpp:12:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program s += i + (n / i); ^ suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:13:1: error: stray '\302' in program suma_divizorilor.cpp:13:1: error: stray '\240' in program suma_divizorilor.cpp:14:1: error: stray '\302' in program if (i * i == n) ^ suma_divizorilor.cpp:14:1: error: stray '\240' in program suma_divizorilor.cpp:14:1: error: stray '\302' in program suma_divizorilor.cpp:14:1: error: stray '\240' in program suma_divizorilor.cpp:14:1: error: stray '\302' in program suma_divizorilor.cpp:14:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program s += i; ^ suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:15:1: error: stray '\302' in program suma_divizorilor.cpp:15:1: error: stray '\240' in program suma_divizorilor.cpp:16:1: error: stray '\302' in program return s; ^ suma_divizorilor.cpp:16:1: error: stray '\240' in program suma_divizorilor.cpp:16:1: error: stray '\302' in program suma_divizorilor.cpp:16:1: error: stray '\240' in program suma_divizorilor.cpp:16:1: error: stray '\302' in program suma_divizorilor.cpp:16:1: error: stray '\240' in program suma_divizorilor.cpp:22:1: error: stray '\302' in program return 0; ^ suma_divizorilor.cpp:22:1: error: stray '\240' in program suma_divizorilor.cpp:22:1: error: stray '\302' in program suma_divizorilor.cpp:22:1: error: stray '\240' in program suma_divizorilor.cpp:22:1: error: stray '\302' in program suma_divizorilor.cpp:22:1: error: stray '\240' in program suma_divizorilor.cpp: In function 'int main()': suma_divizorilor.cpp:26:5: error: redefinition of 'int main()' int main(){ ^ suma_divizorilor.cpp:19:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Suma divizorilor face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.