fork download
  1. var s:string;
  2. a,b:integer;
  3. r:array[0..3] of integer;
  4. i:byte;
  5. begin
  6. for i:=0 to 3 do
  7. r[i]:=0;
  8. writeln('Вводите коды команд, окончание вввода 000');
  9. repeat
  10. repeat
  11. readln(s);
  12. if s='000' then
  13. begin
  14. writeln('Программа завершена');
  15. exit;
  16. end;
  17. val(s,a,b);
  18. if(b<>0)or not(s[1] in ['1'..'4'])
  19. or not(s[2] in ['0'..'3'])
  20. or((s[1] in ['2'..'4'])and not(s[3]in ['0'..'3']))
  21. then writeln('Код введен неверно, повторите');
  22. until (b=0)and(s[1] in ['1'..'4'])and(s[2] in ['0'..'3'])
  23. or((s[1] in ['2'..'4'])and (s[3]in ['0'..'3']));
  24. case s[1] of
  25. '1':r[strtoint(s[2])]:=strtoint(s[3]);
  26. '2':r[strtoint(s[3])]:=r[strtoint(s[2])];
  27. '3':r[strtoint(s[3])]:=r[strtoint(s[3])]+r[strtoint(s[2])];
  28. '4':r[strtoint(s[3])]:=r[strtoint(s[3])]-r[strtoint(s[2])];
  29. end;
  30. for i:=0 to 3 do
  31. write('R',i,'=',r[i],' ');
  32. writeln;
  33. until s='000';
  34. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.pas:1: warning: missing program header
prog.pas:1: warning: missing string capacity -- assuming 255
prog.pas: In main program:
prog.pas:25: error: undeclared identifier `strtoint' (first use in this routine)
prog.pas:25: error:  (Each undeclared identifier is reported only once
prog.pas:25: error:  for each routine it appears in.)
stdout
Standard output is empty