Problem sumofdigits
User zq
Submission Time 2026-11-09 10:41:14
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumofdigits.cpp: In function ‘int main()’:
sumofdigits.cpp:10:39: error: invalid operands of types ‘__gnu_cxx::__promote_2<int, int, double, double>::__type’ {aka ‘double’} and ‘int’ to binary ‘operator%’
10 | currentDigit = (num / (pow(10, i))) % 10;
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~
| | |
| | int
| __gnu_cxx::__promote_2<int, int, double, double>::__type {aka double}