program qtst;

%include lb:[22,320]general3.typ;
%include de:[22,320]qadd.ext;
%include de:[22,320]qsub.ext;
%include de:[22,320]qmul.ext;
%include de:[22,320]qdiv.ext;

var
  val1,val2,sum	: ch30;
  places,ids	: integer;
  test		: ch2;

begin
  write('Test [A,S,M,D]:');
  readln(test);
  
  if (test[1] = 'a') or (test[1] = 'A') then
  begin
    write('Value1:');
    readln(val1);
    write('Value2:');
    readln(val2);
    write('Places:');
    readln(places);
    qadd(val1,val2,sum,places,ids);
    writeln(sum);
    writeln('IDS:',ids);
  end;

  if (test[1] = 's') or (test[1] = 'S') then
  begin
    write('Value1:');
    readln(val1);
    write('Value2:');
    readln(val2);
    write('Places:');
    readln(places);
    qsub(val1,val2,sum,places,ids);
    writeln(sum);
    writeln('IDS:',ids);
  end;

  if (test[1] = 'm') or (test[1] = 'M') then
  begin
    write('Value1:');
    readln(val1);
    write('Value2:');
    readln(val2);
    write('Places:');
    readln(places);
    qmul(val1,val2,sum,places,ids);
    writeln(sum);
    writeln('IDS:',ids);
  end;

  if (test[1] = 'd') or (test[1] = 'D') then
  begin
    writeln('Value1 / value2');
    write('Value1:');
    readln(val1);
    write('Value2:');
    readln(val2);
    write('Places:');
    readln(places);
    qdiv(val1,val2,sum,places,ids);
    writeln(sum);
    writeln('IDS:',ids);
  end;

end.
