fork(4) download
  1. var
  2. data_mem: array[1..10] of integer; // data array
  3. command_mem: string; // command array
  4. i: integer; // index of command array
  5. j: integer; // index of data array
  6. begin
  7. j:=1;
  8. readln(command_mem);
  9.  
  10. for i:=1 to length(command_mem) do begin // the cycle of command processing
  11. if (command_mem[i]='+') then data_mem[j]:= data_mem[j]+1;
  12. if (command_mem[i]='.') then write(chr(data_mem[j]));
  13. end;
  14. end.
Success #stdin #stdout 0s 9128KB
stdin
+++++++++++++++++++++++++++++++++.
stdout
!