Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program ideone;
- var
- c: char = ',';
- sum, cnt: integer;
- begin
- sum := 0;
- cnt := 0;
- while c <> '.' do
- begin
- if (ord('0') <= ord(c)) and (ord(c) <= ord('9')) then
- sum := sum + ord(c) - ord('0');
- cnt := cnt + 1;
- read(c);
- end;
- if cnt - 1 = sum then
- writeln(True)
- else
- writeln(False);
- end.
Advertisement
Add Comment
Please, Sign In to add comment