|
|
back to boardShow all messages Hide all messagesprogram p1135; var a,b,n:integer; i:longint; m1:string[1]; begin readln(n); while not eof do begin read(m1); if (m1='<')or(m1='>') then a:=a+1; if m1='<' then begin b:=b+1; i:=i+a-b; end; if eoln then begin readln; a:=0; b:=0; end; end; writeln(i); end. If the process is infinite then the program should write the word “NO” to the output file. the proccess can not be infinite |
|
|