Advertisement
EWTD

sum of numbers

Sep 14th, 2017
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.15 KB | None | 0 0
  1. program lol;
  2. var
  3. a,b:integer;
  4. begin
  5. readln(a);
  6. b:=0;
  7. while abs(a) > 0 do
  8. begin;
  9. b:=b+ (a mod 10);
  10. a:= a div 10;
  11. end;
  12. writeln(abs(b));
  13. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement