#include
#include
#include
#include
#include
float L1,L2,L3,H1,H2,H3,W1,R1,mmaxx,mmaxy;/*长度的为L1-160,其次为L2-60,定位尺寸L3-50,高度最长为H1-90,
其次为H2-50,宽度为W1-110,圆的半径为的R1-50*/
void Enter_Data() /* 输入长度L1,L2,L3,高度H1,H2,宽度W1,圆的半径R1*/
{
clrscr();
gotoxy(1,6);
printf("Enter the radius of: he circle. \n");
gotoxy(1,8);
printf("Entere in L1 range(>=16.0):\n");
scanf("%f",&L1);
printf("Entere in L2 range(>=6.0): \n");
scanf("%f",&L2);
printf("Entere in L3 range(>=5.0): \n");
scanf("%f",&L3);
printf("Entere in H1 range(>=9.0): \n");
scanf("%f",&H1);
printf("Entere in H2 range(>=5.0): \n");
scanf("%f",&H2);
printf("Entere in H3 range(>=5.0): \n");
scanf("%f",&H3);
printf("Entere in W1 range(>=11.0): \n");
scanf("%f",&W1);
printf("Entere in R1 range(>=2.5): \n");
scanf("%f",&R1);
}
void save_Data()
{
FILE *fp;
if((fp=fopen("date.txt","w"))==NULL)
{ printf(" open fail!!\n"); }
fprintf(fp,"L1=%f\n",L1);
fprintf(fp,"L2=%f\n",L2);
fprintf(fp,"L3=%f\n",L3);
fprintf(fp,"H1=%f\n",H1);
fprintf(fp,"H2=%f\n",H2);
fprintf(fp,"H3=%f\n",H3);
fprintf(fp,"W1=%f\n",W1);
fprintf(fp,"R1=%f\n",R1);
fclose (fp);
}
void Initialize() /* 初始化图形系统*/
{
int graphdriver,graphmode,errorcode;
graphdriver=DETECT;
initgraph(&graphdriver,&graphmode,"\\bc>bgi");
errorcode=graphresult();
if(errorcode!=grOk)
{
printf("graphics system error: %s",grapherrormsg(errorcode));
exit(1);
}
setbkcolor(15);/*背景颜色白色*/
mmaxx=getmaxx()/2-150; /* 获取x方向最大分辨率*/
mmaxy=getmaxy()/2-50;/* 获取y方向最大分辨率 */
}
void Base_Center_Line() /* 画基准线函数 */
{
int i;
setcolor(1); /*blue*/
setlinestyle(0,0,3); /*设置线型*/
rectangle(mmaxx-120,mmaxy-85,mmaxx+300,mmaxy+212); /*画内边框*/
setlinestyle(0,0,1); /*设置线型*/
rectangle(mmaxx-145,mmaxy-95,mmaxx+310,mmaxy+222);/*画外边框*/
rectangle(mmaxx+120,mmaxy+156,mmaxx+300,mmaxy+212);/*画标题栏*/
line(mmaxx+250,mmaxy+212,mmaxx+250,mmaxy+156);
line(mmaxx+250,mmaxy+174,mmaxx+300,mmaxy+174);
line(mmaxx+200,mmaxy+194,mmaxx+300,mmaxy+194);
line(mmaxx+200,mmaxy+212,mmaxx+200,mmaxy+156);
line(mmaxx+200,mmaxy+203,mmaxx+250,mmaxy+203);
line(mmaxx+200,mmaxy+184,mmaxx+250,mmaxy+184);
line(mmaxx+206,mmaxy+203,mmaxx+206,mmaxy+194);
line(mmaxx+213,mmaxy+203,mmaxx+213,mmaxy+194);
line(mmaxx+219,mmaxy+203,mmaxx+219,mmaxy+194);
line(mmaxx+225,mmaxy+203,mmaxx+225,mmaxy+184);
line(mmaxx+237,mmaxy+203,mmaxx+237,mmaxy+184);
for( i=1;i<=7;i++)
{
line(mmaxx+120,mmaxy+212-i*7,mmaxx+200,mmaxy+212-i*7);
}
line(mmaxx+132,mmaxy+212,mmaxx+132,mmaxy+184);
line(mmaxx+144,mmaxy+212,mmaxx+144,mmaxy+184);
line(mmaxx+160,mmaxy+212,mmaxx+160,mmaxy+184);
line(mmaxx+172,mmaxy+212,mmaxx+172,mmaxy+156);
line(mmaxx+184,mmaxy+212,mmaxx+184,mmaxy+156);
line(mmaxx+130,mmaxy+184,mmaxx+130,mmaxy+156);
line(mmaxx+140,mmaxy+184,mmaxx+140,mmaxy+156);
line(mmaxx+156,mmaxy+184,mmaxx+156,mmaxy+156);
}
void draw_picture()
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试