#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 | #53625463 | Utilizator | |
Fișier | suma_cifrelor.cpp | Dimensiune | 606 B |
Data încărcării | 06 Noiembrie 2024, 19:03 | Scor / rezultat | Eroare de compilare |
suma_cifrelor.cpp:57:5: warning: missing terminating " character [enabled by default] " ^ suma_cifrelor.cpp:57:5: error: missing terminating " character suma_cifrelor.cpp:3:7: error: expected nested-name-specifier before 'nbamespace' using nbamespace std; ^ suma_cifrelor.cpp:3:7: error: 'nbamespace' has not been declared suma_cifrelor.cpp:3:18: error: expected ';' before 'std' using nbamespace std; ^ suma_cifrelor.cpp:3:18: error: 'std' does not name a type suma_cifrelor.cpp: In function 'int main()': suma_cifrelor.cpp:15:5: error: 'cout' was not declared in this scope cout<<"introduceti numar: "; ^ suma_cifrelor.cpp:15:5: note: suggested alternative: In file included from suma_cifrelor.cpp:2:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ suma_cifrelor.cpp:16:5: error: 'cin' was not declared in this scope cin>>numar; ^ suma_cifrelor.cpp:16:5: note: suggested alternative: In file included from suma_cifrelor.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ suma_cifrelor.cpp:17:38: error: 'sumacifloriterativ' was not declared in this scope int suma=sumacifloriterativ(numar); ^ suma_cifrelor.cpp:18:53: error: 'endl' was not declared in this scope cout<<"Suma cifrelor (metoda iterativa)"<<suma<<endl; ^ suma_cifrelor.cpp:18:53: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from suma_cifrelor.cpp:2: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ suma_cifrelor.cpp: At global scope: suma_cifrelor.cpp:58:1: error: expected declaration before '}' token } ^
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ă.