fork download
  1. program ideone;
  2. var a, s: integer;
  3. begin
  4. s := 0;
  5. a := 12345;
  6.  
  7. repeat
  8. s := s + a mod 10;
  9. a := a div 10;
  10. until a > 0;
  11.  
  12. writeln(s);
  13. writeln(a);
  14. end.
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
5
1234