Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл: Источник:
Скачиваний:
325
Добавлен:
04.03.2014
Размер:
2 Кб
Скачать
program FDHG;

Uses crt;
var
   s, a, b, u:integer;
   o:real;
   ch:char;
   y:byte;
procedure pr;
 var t:byte;
 begin
     window (21, 5, 60, 15);
     textbackground(green);
     clrscr;
     textcolor(magenta);
     for t:=2 to 5 do
                   begin
                   gotoxy(5, t);
                   case t of
                   2: write('plus');
                   3: write('umnojit');
                   4: write('delit');
                   5: write('exit');
             end;
             end;
     gotoxy(5, 1);
     end;

procedure p(var y:byte);
 begin
  repeat
  y:=wherey;
  ch:=readkey;
  if ch=#0 then ch:=readkey;
  case ord(ch) of
  72: begin pr;
       gotoxy(5,y-1);
       textbackground(0);
       textcolor(11);
case y-1 of
  2: write('plus');
  3: write('umnojit');
  4: write('delit');
  5: write('exit');
  else pr;end;end;
80: begin pr;
  gotoxy(5, y+1);
  textbackground(0);
  textcolor(11);
  case y+1 of
  2: write('plus');
  3: write('umnojit');
  4: write('delit');
  5: write('exit');
   else pr;end;end;
27: else pr;end;
 until ord(ch)=13;
 gotoxy(5,7); end;

procedure zap(var a1, b1:integer);
     begin
   writeln;
   write('a=');
   readln(a1);
   write('b=');
   readln(b1);
  end;

 begin
   textbackground(0);clrscr;
 pr;p(y);
 case y of
 2: begin write('plus');zap(a, b);end;
 3: begin write('umnojit');zap(a, b);end;
 4: begin write('delit');zap(a, b);end;
 5: write('exit');
 end;
  case y of
  2: begin
      s:=a+b;writeln('s=', s); readln;end;
  3: begin
      u:=a*b;writeln('u=', u); readln;end;
  4: begin
      o:=a/b; writeln('o=', o:3:3); readln;end;
  5:
   end;
end.