| 
| Идёт турнир! |  | В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания. 
 |  
 | 
| imesecan | 13.фев.2011 в 10:55:31 |  |  | 0 | The question doesn't mention the number of digits. So, the number can have 4 or five digits or 10 digits. 
 As far as the number has digits we take the digits one by one; and then calculate the sum.
 
 
 |  | imesecan | 17.фев.2011 в 09:06:42 |  |  | 1 | You can use a while loop copiednum=num;
 while (copiednum>0)
 
 and always get the last digit using %10 then divide the number by 10. When number has 1 digit and you divide it by 10, the number will be then 0 and it will quit from the loop.
 
 
 |  | imesecan | 20.фев.2011 в 13:24:51 |  |  | 2 | Реплика удалена 
 
 |  | imesecan | 20.фев.2011 в 13:53:15 |  |  | 3 | Your program using a loop somewhere and it's going probably  infinite :) 
 Or it's expected to solve in one second but your solution is taking more...
 
 
 |  
 |