SlepoiKrot

Untitled

Feb 24th, 2018
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Project2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils;
  7. var
  8. s, s1: string;
  9. i, t: integer;
  10. begin
  11. readln (s);
  12. s := s + '0000';
  13. i := 0;
  14. for t := 1 to length (s) - 4 do begin
  15. if (s[t] = '<') and (s[t+1] = '-') and (s[t+2] = '-') and (s[t+3] = '<') and (s[t+4] = '<') or (s[t] = '>') and (s[t+1] = '>') and (s[t+2] = '-') and (s[t+3] = '-') and (s[t+4] = '>') then
  16. inc (i);
  17. end;
  18. writeln (i);
  19. readln;
  20. readln;
  21. end.
RAW Paste Data