Info
1. Chương trình tạo một chiếc đồng hồ Gimico trên màn hình máy tính dùng Pascal. uses crt,graph,dos; var x,y,x1,y1,x2,y2,goc: integer; goc1,goc2,goc3,old,gd,gm:integer; gio,phut,giay,mili:word; so,gio1,phut1,giay1:string; rad:real; procedure kim_giay(goc:integer); begin rad:=goc*pi/180; x1:=round(x+150*sin(rad)); y1:=round(y-150*cos(rad)); setlinestyle(0,0,1); line(x,y,x1,y1); if (goc mod 6=0) then begin sound(3000);delay(10);nosound; end; end; procedure kim_phut(goc1:integer); begin rad:=goc1*pi/180; x1:=round(x+150*sin(rad)); y1:=round(y-150*cos(rad)); setlinestyle(0,0,3); line(x,y,x1,y1); end; procedure kim_gio(goc2:integer); begin rad:=goc2*pi/180; x1:=round(x+100*sin(rad)); y1:=round(y-100*cos(rad)); setlinestyle(1,1,10); line(x,y,x1,y1); end; Begin gd:=detect; initgraph(gd,gm,”); (* ——– Ve 3 vong tron ——- *) setcolor(10); setbkcolor(white); x:=getmaxx div 2; y:=getmaxy div 2; setfillstyle(1,10); setcolor(4); circle(x,y,210); circle(x,y,170); circle(x,y,5); floodfill(x,y,4); setfillstyle(2,14); floodfill(x+11,y+11,4); setfillstyle(1,blue); floodfill(x+88,y+158,4); (* ——- Ve so tren mat dong ho ——— *) setcolor(12); settextstyle(0,0,2); outtextxy(x-18,y-197,’12′); outtextxy(x+183,y-5,’3′); outtextxy(x-196,y-5,’9′); outtextxy(x-10,y+183,’6′); outtextxy(x+160,y-98,’2′); outtextxy(x-180,y-98,’10′); outtextxy(x+89,y-170,’1′); outtextxy(x-114,y-170,’11′); outtextxy(x+160,y+88,’4′); outtextxy(x-172,y+88,’8′); outtextxy(x+88,y+158,’5′); outtextxy(x-110,y+154,’7′); (* ——– Ke mac dong ho ——– *) setcolor(12); settextstyle(0,0,1); outtextxy(x-20,y+120,’VIETNAM’); (* —– Ve 3 kim dong ho ——- *) setwritemode(xorput); goc:=0; goc1:=0; goc2:=0; gettime(gio,phut,giay,mili); goc:=giay*6; old:=giay; kim_giay(goc); goc1:=phut*6+ giay div 10; kim_phut(goc1); goc2:=gio*30+phut div 2; kim_gio(goc2); (* ——– Cho dong ho chay ———– *) repeat gettime(gio,phut,giay,mili);...