Скачиваний:
2
Добавлен:
25.05.2014
Размер:
1.06 Кб
Скачать
#include "iostream.h"
#include <STDLIB.H>
#include "Struct.CPP"
#include "SQUARE.CPP"


void main  (void)
{
  void *p;
  setfillstyle(1,8);
  bar(5,5,100,100);
  setcolor(15);
  circle(14,14,3);
  p=(void *)new char[imagesize(11,11,17,17)];
  getimage(11,11,17,17,p);
  int x=320,y=240;

  TBorder Scr={1,1,635,475,FILL,8};
//  TBorder Wnd= {200,150,400,200,UP|FILL,7};
  //putimage(x,y,p,0);
  randomize();
 do
 {
   clrkbd();
   DrawBorder(Scr);
   Cursor(Scr,p,6,6,x,y,0);
   TSquare a(x,y,random(50)+20);
   a.Paint(2);
   setcolor(Palette.simple);
   outtextxy(x,y,"A");
   Cursor(Scr,p,6,6,x,y,0);
   TSquare b(x-5,y-5,random(50)+20);
   b.Paint(3);
   setcolor(Palette.simple);
   outtextxy(x-5,y-5,"B");

   TSquare c,d;
   c=a-b;
   c.Paint(4);
   setcolor(Palette.simple);
   outtextxy(c.GetX()-5,c.GetY()-5,"A-B");
   d=a+b;
   d.Paint(5);
   setcolor(Palette.simple);
   outtextxy(d.GetX()-5,d.GetY()-5,"A+B");

   getch();
   clrkbd();

 }
 while (YesNo("Do you want to test it once more?\0"));
}
Соседние файлы в папке Zad2