Добавил:
korayakov
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабы / С++Builder / Laba1 / ZASHITA
.CPP#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <iostream.h>
int scan,x=100,y=100;
void removecircle(int x,int y, int r)
{setcolor(0);
circle(x,y,r);
setcolor(15);
}
int main(void)
{
start:
clrscr();
gotoxy(20,10);
cout<<"1. Draw Circle";
gotoxy(20,11);
cout<<"2. Draw Rectangle";
gotoxy(20,12);
cout<<"3. Quit";
gotoxy(20,15);
cout<<"Your Choice: ";
int k=getch();
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "");
setcolor(13);
if (k=='3') return 0;
switch(k)
{
case '1': circle(320, 240, 30);break;
case '2':
line(300,200,300,280);
line(300,280,340,280);
line(340,280,340,200);
line(340,200,300,200);
break;
}
getch();
closegraph();
goto start;
return 0;
}