OPTADS360
AANETWORK
AMBIENT
YOMEDIA
Banner-Video
IN_IMAGE

Vẽ mô phỏng tháp phát sóng ăng-ten.

  bởi Lan Anh 28/11/2021
ADSENSE/lession_isads=0
QUẢNG CÁO
 

Câu trả lời (1)

  • #include<stdio.h>//ham printf
    
    #include<graphics.h>
    
    #include<conio.h>//ham getch(), kbhit()
    
    #include<stdlib.h>//ham random, exit
    
    #include<dos.h>//ham delay
    
    const CHAM=10;
    
    int mx,my;
    
    void khoitao();
    
    void vecot();
    
    void main()
    
    {int dx=10;
    
    khoitao();
    
    vecot();
    
    while (!kbhit())
    
    {setcolor(random(16));
    
    circle(mx,my,dx);
    
    delay(CHAM);
    
    dx=dx+10;
    
    if (dx>2*my)
    
    {delay(20*CHAM);
    
    dx=10;
    
    vecot();
    
    }
    
    }
    
    closegraph();
    
    }
    
    void vecot()
    
    {setbkcolor(BLUE);
    
    cleardevice();
    
    setcolor(RED);
    
    setfillstyle(6,LIGHTRED);
    
    line(mx,my,mx-20,my+15);
    
    line(mx,my,mx+20,my+15);
    
    line(mx-20,my+15,mx-40,2*my);
    
    line(mx+20,my+15,mx+40,2*my);
    
    line(mx-40,2*my,mx+40,2*my);
    
    floodfill(mx,my+20,RED);
    
    }
    
    void khoitao()
    
    {int gdrv=DETECT,gmode,errorcode;
    
    initgraph(&gdrv,&gmode,"..\\BGI");
    
    errorcode=graphresult();
    
    if (errorcode!=grOk)
    
    {printf("Graphics error : %s\n",grapherrormsg(errorcode));
    
    printf("Press any key to halt ...");
    
    getch();
    
    exit(1);
    
    }
    
    mx=getmaxx()/2;my=getmaxy()/2;
    
    }
      bởi Trinh Hung 28/11/2021
    Like (0) Báo cáo sai phạm

Nếu bạn hỏi, bạn chỉ thu về một câu trả lời.
Nhưng khi bạn suy nghĩ trả lời, bạn sẽ thu về gấp bội!

Lưu ý: Các trường hợp cố tình spam câu trả lời hoặc bị báo xấu trên 5 lần sẽ bị khóa tài khoản

Gửi câu trả lời Hủy
 
 

Các câu hỏi mới

NONE
OFF