Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. program ch5;
  2. {$H+}
  3. var
  4. stri : string;
  5. som, pre, c, e, x, sum : integer;
  6. BEGIN
  7. repeat
  8. readln(stri);
  9. stri := stri + ' ';
  10. pre := 0;
  11. sum := 0;
  12. repeat
  13. c := pos(' ', stri);
  14. Val(copy(stri, pre+1, c-1-pre), x, e);
  15. sum := sum + x;
  16. pre := c;
  17. stri[c] := 'n';
  18. until c=0;
  19. writeln(stri);
  20. until stri='n';
  21. END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement