Скачиваний:
285
Добавлен:
04.03.2014
Размер:
2.55 Кб
Скачать
PROGRAM LENA;
Uses CRT;

var nc:byte;
ch:char;
a, b:real;

Procedure Zap(var a, b:real);
begin
TextMode(co80);TextBackGround(0);Clrscr;
Write('a= ');Readln(a);
Write('b= ');Readln(b);
end;

procedure w(n:integer);
var nc:byte;
begin
textbackground(0);
clrscr;
TextBackGround(11);
Window(11,3,61,5);
Clrscr;
textcolor(15);
textbackground(1);
window(10,2,60,4);
clrscr;
Writeln;
write(' Ћ ‘ Ќ Ћ ‚ Ќ Ћ … Њ … Ќ ћ');
if n=1 then nc:=12 else nc:=2;
textbackground(nc);
window(20,7,50,7);
clrscr;
write(' ‘“ЊЊЂ');
if n=2 then nc:=12 else nc:=2;
textbackground(nc);
window(20,9,50,9);
clrscr;
write(' ЏђЋ€‡‚…„…Ќ€… ');
if n=3 then nc:=12 else nc:=2;
textbackground(nc);
window(20,11,50,11);
clrscr;
write(' —Ђ‘’ЌЋ…');
if n=4 then nc:=12 else nc:=2;
textbackground(nc);
window(20,13,50,13);
clrscr;
write(' ‚›•Ћ„');
end;

begin
nc:=1;
w(1);
while true do
begin
ch:=#1;
while(ch<>#13 )and(ch<>#0) do
ch:=readkey;
if ch=#0 then
ch:=readkey;
case ch of
#72: nc:=nc-1;
#80: nc:=nc+1;
#13: case nc of
1:begin
zap(a, b);
Writeln('a+b = ', a+b:4:2);Readln;
end;
2:begin
zap(a, b);
Writeln('a*b = ', a*b:4:2);Readln;
end;
3:begin
zap(a, b);
If b=0 then writeln('„Ґ«Ґ­ЁҐ ­  ­®«м') else
Writeln('a/b = ', a/b:4:2);Readln;
end;
4:begin EXIT; end;
end;
end;
if nc=0 then nc:=4;
if nc=5 then nc:=1;
w(nc);
end;
end.
Соседние файлы в папке DIMA