Posts by Rogério Lucas • 13 points
1 post
-
1
votes1
answer332
viewsQ: Sum of digits of a string only works when I do a subtraction I don’t understand
The program receives a string size up 10^6 and add the digits. I made the code, but to each loop 48 is added to the sum variable. If I modify the tenth line as soma = soma + nome[x] - 48 the problem…