>[info]画图,综合例子。(在TC中实现)。
~~~C
# define PAI 3.1415926
# define B 0.809
# include "graphics.h"
#include "math.h"
int main()
{
int i,j,k,x0,y0,x,y,driver,mode;
float a;
driver=CGA;mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(3);
setbkcolor(GREEN);
x0=150;y0=100;
circle(x0,y0,10);
circle(x0,y0,20);
circle(x0,y0,50);
for(i=0;i<16;i++)
{
a=(2*PAI/16)*i;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a)*B);
setcolor(2); line(x0,y0,x,y);
}
setcolor(3);circle(x0,y0,60);
/* Make 0 time normal size letters */
settextstyle(DEFAULT_FONT,HORIZ_DIR,0);
outtextxy(10,170,"press a key");
getch();
setfillstyle(HATCH_FILL,YELLOW);
floodfill(202,100,WHITE);
getch();
for(k=0;k<=500;k++)
{
setcolor(3);
for(i=0;i<=16;i++)
{
a=(2*PAI/16)*i+(2*PAI/180)*k;
x=ceil(x0+48*cos(a));
y=ceil(y0+48+sin(a)*B);
setcolor(2); line(x0,y0,x,y);
}
for(j=1;j<=50;j++)
{
a=(2*PAI/16)*i+(2*PAI/180)*k-1;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a)*B);
line(x0,y0,x,y);
}
}
restorecrtmode();
}
~~~
- C语言模块
- 基础入门
- 各种变量类型
- 条件编译
- 100例
- day1
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day2
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day3
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day4
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day5
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day6
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- day7
- 1.c
- 2.c
- 3.c
- 4.c
- 5.c
- 6.c
- 7.c
- 8.c
- 9.c
- 10.c
- linux基础知识
- 目录
- 系统设置
- ftp管理
- ftp-auth
- 进程
- ssh登录
- 权限属性
- 用户/用户组
- 安装命令
- 数据库操作
- 虚拟机vmvare-tools安装
- VI命令
- 上传下载
- error
- 虚拟机mac