1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include<iostream>
#include<graphics.h>
#include <windows.h>
using namespace std;
int main()
{
initwindow(500,500);
setcolor(RED);
setlinestyle(0,1,4);
settextstyle (4,HORIZ_DIR,5);
int x,y;
rectangle(140,130,220,180); outtextxy(160,135,"7");
rectangle(240,130,320,180);
x=0;y=0;
getmouseclick(WM_LBUTTONDOWN,x,y);
if (x>240&&x<320,y>130,y<180)
{
outtextxy(260,135,"7");
}
getch();
return 0;
}
|