日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

优美图案c语言程序,C语言经典例题100例——C语言练习实例65解答(一个最优美的图案)...

發布時間:2024/3/13 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 优美图案c语言程序,C语言经典例题100例——C语言练习实例65解答(一个最优美的图案)... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題目:一個最優美的圖案(在TC中實現)。

程序分析:無。

程序源代碼:

// 百寶箱工作室官方網址 http://www.baibaox.com

// 百寶箱工作室業務介紹 http://www.baibaox.com/BusinessIntroduction.html

#include "graphics.h" //VC6.0中是不能運行的,要在Turbo2.0/3.0中

#include "math.h"

#include "dos.h"

#include "conio.h"

#include "stdlib.h"

#include "stdio.h"

#include "stdarg.h"

#define MAXPTS 15

#define PI 3.1415926

struct PTS {

int x,y;

};

double AspectRatio=0.85;

void LineToDemo(void)

{

struct viewporttype vp;

struct PTS points[MAXPTS];

int i, j, h, w, xcenter, ycenter;

int radius, angle, step;

double rads;

printf(" MoveTo / LineTo Demonstration" );

getviewsettings( &vp );

h = vp.bottom - vp.top;

w = vp.right - vp.left;

xcenter = w / 2; /* Determine the center of circle */

ycenter = h / 2;

radius = (h - 30) / (AspectRatio * 2);

step = 360 / MAXPTS; /* Determine # of increments */

angle = 0; /* Begin at zero degrees */

for( i=0 ; i

rads = (double)angle * PI / 180.0; /* Convert angle to radians */

points[i].x = xcenter + (int)( cos(rads) * radius );

points[i].y = ycenter - (int)( sin(rads) * radius * AspectRatio );

angle += step; /* Move to next increment */

}

circle( xcenter, ycenter, radius ); /* Draw bounding circle */

for( i=0 ; i

for( j=i ; j

moveto(points[i].x, points[i].y); /* Move to beginning of cord */

lineto(points[j].x, points[j].y); /* Draw the cord */

}

}

}

int main()

{

int driver,mode;

driver=CGA;mode=CGAC0;

initgraph(&driver,&mode,"");

setcolor(3);

setbkcolor(GREEN);

LineToDemo();

}

總結

以上是生活随笔為你收集整理的优美图案c语言程序,C语言经典例题100例——C语言练习实例65解答(一个最优美的图案)...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。