#10
Suma Cifrelor
Să se scrie un program care să determine suma cifrelor unui număr natural citit de la tastatură.
Problema | Suma Cifrelor | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #31214821 | Utilizator | |
Fișier | suma_cifrelor.c | Dimensiune | 131 B |
Data încărcării | 06 Octombrie 2021, 17:29 | Scor / rezultat | 0 puncte |
suma_cifrelor.c: In function 'main': suma_cifrelor.c:4:1: warning: passing argument 2 of 'sscanf' from incompatible pointer type [enabled by default] sscanf("%i",&n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from suma_cifrelor.c:1: /usr/include/stdio.h:448:12: note: expected 'const char * __restrict__' but argument is of type 'int *' extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s, ^ suma_cifrelor.c:4:1: warning: format not a string literal and no format arguments [-Wformat-security] sscanf("%i",&n); ^ suma_cifrelor.c:13:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Exited with error status 2 | 10 | 0 | Exemplu | |
2 | 0 secunde | Exited with error status 2 | 10 | 0 | ||
3 | 0 secunde | Exited with error status 2 | 20 | 0 | ||
4 | 0 secunde | Exited with error status 2 | 20 | 0 | ||
5 | 0 secunde | Exited with error status 2 | 20 | 0 | ||
6 | 0 secunde | Exited with error status 2 | 20 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Suma Cifrelor 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ă.