#2601
Scrieți un program care calculează suma pătratelor cifrelor unui număr natural de trei cifre citit de la tastatură.
Problema | sumapatratecifre | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58278334 | Utilizator | |
Fișier | sumapatratecifre.cpp | Dimensiune | 337 B |
Data încărcării | 23 Mai 2025, 21:07 | Scor / rezultat | Eroare de compilare |
sumapatratecifre.cpp: In function 'int main()': sumapatratecifre.cpp:8:18: error: expected identifier before '(' token int b = [(abc-c) / 10] %10; ^ sumapatratecifre.cpp: In lambda function: sumapatratecifre.cpp:8:32: error: expected '{' before '%' token int b = [(abc-c) / 10] %10; ^ sumapatratecifre.cpp: In function 'int main()': sumapatratecifre.cpp:8:32: error: no match for 'operator%' (operand types are 'main()::__lambda0' and 'int') sumapatratecifre.cpp:9:9: error: redeclaration of 'int c' int c = [(abc-c) / 10 - b] %10; ^ sumapatratecifre.cpp:7:9: error: 'int c' previously declared here int c = abc %10; ^ sumapatratecifre.cpp:9:14: error: expected identifier before '(' token int c = [(abc-c) / 10 - b] %10; ^ sumapatratecifre.cpp: In lambda function: sumapatratecifre.cpp:9:32: error: expected '{' before '%' token int c = [(abc-c) / 10 - b] %10; ^ sumapatratecifre.cpp: In function 'int main()': sumapatratecifre.cpp:9:32: error: no match for 'operator%' (operand types are 'main()::__lambda1' and 'int') sumapatratecifre.cpp:10:17: error: 'a' was not declared in this scope cout << a*a+b*b+c*c; ^ sumapatratecifre.cpp: At global scope: sumapatratecifre.cpp:19:2: error: expected unqualified-id before 'if' if (abc<100 || abc > 999) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sumapatratecifre 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ă.