program lipp; uses graph; var draiver, mood, viga: integer; s:string; procedure Kaivitagraafika; begin draiver:=detect; Initgraph(draiver, mood, ''); viga:=GraphResult; if viga <> GrOK then begin writeln('Graafikaviga ',GraphErrorMsg(viga)); Halt(1); end; end; procedure saksa; begin KaivitaGraafika; setcolor(red); setfillstyle(Solidfill,red); rectangle(50,200,550,300); floodfill(51,201,red); setcolor(yellow); setfillstyle(Solidfill,yellow); rectangle(50,300,550,400); floodfill(51,301,yellow); setcolor(red); setfillstyle(Solidfill,red); rectangle(50,100,550,200); readln; CloseGraph; end; procedure pransusmaa; begin KaivitaGraafika; setcolor(blue); setfillstyle(Solidfill,blue); rectangle(50,100,217,400); floodfill(51,101,blue); setcolor(white); setfillstyle(Solidfill,white); rectangle(217,100,384,400); floodfill(218,101,white); setcolor(red); setfillstyle(Solidfill,red); rectangle(384,100,551,400); floodfill(385,101,red); readln; closegraph; end; procedure soome; begin KaivitaGraafika; setcolor(white); setfillstyle(Solidfill,white); rectangle(50,100,550,400); floodfill(51,101,white); setcolor(blue); setfillstyle(Solidfill,blue); rectangle(50,210,550,290); floodfill(51,211,blue); setcolor(blue); setfillstyle(Solidfill,blue); rectangle(175,100,255,400); floodfill(176,101,blue); floodfill(176,291,blue); readln; closegraph; end; procedure jaapan; begin KaivitaGraafika; setcolor(white); setfillstyle(Solidfill,white); rectangle(50,100,550,400); floodfill(51,101,white); setcolor(red); setfillstyle(SolidFill,red); circle(300,250,75); floodfill(300,250,red); readln; CloseGraph; end; procedure eesti; begin KaivitaGraafika; setcolor(blue); setfillstyle(Solidfill,blue); rectangle(50,100,550,200); floodfill(51,101,blue); setcolor(black); setfillstyle(Solidfill,black); rectangle(50,200,550,300); floodfill(51,201,black); setcolor(white); setfillstyle(Solidfill,white); rectangle(50,300,550,400); floodfill(51,301,white); readln; CloseGraph; end; begin writeln('Valige lippu:EESTI LIPP'); writeln(' SAKSA LIPP'); writeln(' SOOME LIPP'); writeln(' PRANSUSMAA LIPP'); writeln(' JAAPANI LIPP'); readln(s); if s='EESTI LIPP' then eesti; if s='SOOME LIPP' then soome; if s='SAKSA LIPP' then saksa; if s='PRANSUSMAA LIPP' then pransusmaa; if s='JAAPANI LIPP' then jaapan; end.