| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 758 人关注过本帖
标题:难难难死了!
取消只看楼主 加入收藏
gogogo208
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-6-19
收藏
 问题点数:0 回复次数:4 
难难难死了!

stop:
cleardevice();
printf("input BeiShu n:");
scanf("%f",&n);
cleardevice();
{if (n!=0)
fun(300,200,r1,r2,x1,h,n);
getch();
goto stop;
else (我想知道这添什么能出去呀?);
}
}

搜索更多相关主题的帖子: fun 
2006-06-28 11:09
gogogo208
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-6-19
收藏
得分:0 
/* Note:Your choice is C IDE */
#include "graphics.h"
#include "stdio.h"
#include "math.h"
void picture1(int X,int Y,float r1,float r2,float x1,float h)
{
setcolor(15);
setlinestyle(0,0,3);
circle(X,Y,r1);
setlinestyle(0,0,3);
line(X-r2,Y,X-r2,Y+x1);
line(X+r2,Y,X+r2,Y+x1);
rectangle(X-3*r2,Y+x1,X+r2,Y+x1+h);
line(X-3*r2,Y+x1,X-r2,Y);
arc(X,Y,0,180,r2);
setcolor(4);
setlinestyle(2,0,0);
line(X-r2-10,Y,X+r2+10,Y);
line(X,Y+r2+10,X,Y-r2-10);
line(X-3*r2+r2-r1,Y+x1,X-3*r2+r2-r1,Y+x1+h);
line(X-3*r2+r2,Y+x1-5,X-3*r2+r2,Y+x1+h+5);
line(X-3*r2+r2+r1,Y+x1,X-3*r2+r2+r1,Y+x1+h);
setcolor(6);
setlinestyle(0,0,3);
rectangle(10,10,630,470);
line(500,420,500,470);
line(500,420,630,420);
setlinestyle(0,0,1);
line(500,445,630,445);line(565,420,565,470);
}
void picture2(int X,int Y,float r1,float r2,float x1,float h)
{ setcolor(15);
setlinestyle(0,0,3);
line(X-3*r2,Y+x1+h+10,X+r2,Y+x1+h+10);
line(X-3*r2,Y+x1+h+10,X-3*r2,Y+x1+h+10+2*r2);
line(X-3*r2+r2,Y+x1+h+10+3*r2,X-3*r2+4*r2,Y+x1+h+10+3*r2);
line(X-3*r2+4*r2,Y+x1+h+10+3*r2,X+r2,Y+x1+h+10);
line(X-3*r2,Y+x1+h+10+r2,X-3*r2+2*r2,Y+x1+h+10+r2);
line(X-3*r2+2*r2,Y+x1+h+10,X-3*r2+2*r2,Y+x1+h+10+2*r2);
line(X-3*r2+2*r2,Y+x1+h+10+2*r2,X-3*r2+2*r2+2*r2,Y+x1+h+10+2*r2);
circle(X-3*r2+r2,Y+x1+h+10+2*r2,r1);
setlinestyle(0,0,3);
arc(X-3*r2+r2,Y+x1+h+10+2*r2,180,270,r2);
setcolor(4);
setlinestyle(2,0,0);
line(X-3*r2+r2-r1-6,Y+x1+h+10+2*r2,X-3*r2+r2+r1+6,Y+x1+h+10+2*r2);
line(X-3*r2+r2,Y+x1+h+10+2*r2-r1-6,X-3*r2+r2,Y+x1+h+10+2*r2+r1+6);
line(X-r1,Y+x1+h+10,X-r1,Y+x1+h+10+2*r2);
line(X+r1,Y+x1+h+10,X+r1,Y+x1+h+10+2*r2);
line(X,Y+x1+h+6,X,Y+x1+h+10+2*r2+6);

}
void picture3(int X,int Y,float r1,float r2,float x1,float h)
{ setcolor(4);
#define aa X+r2+20
#define bb Y-r2
setlinestyle(3,0,0);
line(aa,bb+r2-r1,aa+2*r2,bb+r2-r1);
line(aa,Y+r1,aa+2*r2,Y+r1);
line(aa+2*r2-r1,Y+x1,aa+2*r2-r1,Y+x1+h);
line(aa+2*r2+r1,Y+x1,aa+2*r2+r1,Y+x1+h);
setlinestyle(2,0,0);
line(aa-7,bb+r2,aa+2*r2+7,bb+r2);
line(aa+2*r2,bb+r2+x1-6,aa+2*r2,bb+x1+h+r2+6);
setcolor(15);
setlinestyle(0,0,3);
line(aa,bb,aa,bb+r2+x1+h);
line(aa,bb+r2+x1+h,aa+3*r2,bb+r2+x1+h);
line(aa+3*r2,bb+r2+x1+h,aa+3*r2,bb+r2+x1);
line(aa+3*r2,bb+r2+x1,aa,bb+r2+x1);
line(aa+2*r2,bb+r2+x1,aa+2*r2,bb);
line(aa,bb,aa+2*r2,bb);
line(aa,bb+r2,aa+r2,bb+r2);
line(aa+r2,bb+r2,aa+r2,bb+r2+x1);
}
void fun(int X,int Y,float r1,float r2,float x1,float h,float n)
{
picture1(X,Y,r1*n,r2*n,x1*n,h*n);
}
#include "stdlib.h"

main()
{int X,Y;
float r1,r2,x1,h,n;
int driver=VGA,mode=2;
initgraph(&driver,&mode,"");
setbkcolor(1);
printf("Draw a bolt,input X Y r1 r2 x1 h: ");
scanf("%d%d%f%f%f%f",&X,&Y,&r1,&r2,&x1,&h);
cleardevice();
picture1(X,Y,r1,r2,x1,h);picture2(X,Y,r1,r2,x1,h);picture3(X,Y,r1,r2,x1,h);
getch();
stop:
cleardevice();
printf("input BeiShu n:");
scanf("%f",&n);
cleardevice();
{if (n!=0)
fun(300,200,r1,r2,x1,h,n);
getch();
goto stop;
if (n=0)
printf("skdjfk");
}
}
2006-06-28 11:12
gogogo208
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-6-19
收藏
得分:0 

我是想在哪个地方放大倍数但是不知道怎么能退出来

2006-06-28 11:14
gogogo208
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-6-19
收藏
得分:0 
谢谢各位了我搞明白了
2006-06-28 11:18
gogogo208
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-6-19
收藏
得分:0 

stop:
cleardevice();
printf("input BeiShu n:");
scanf("%f",&n);
cleardevice();
if(n!=0){
fun(300,200,r1,r2,x1,h,n);
getch();
goto stop;}
else exit(0);
}

if的括号搞错了!!所以else就不行了,不好意思我太笨了

2006-06-28 11:22
快速回复:难难难死了!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.042147 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved