|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
在VC中运行正常,但把这个程序复制到桌面或直接点DEBUG下的EXE文件,输入数值,打印出数值后闪退
(比如输入58,40,55,70,55,85,2)
#include<conio.h>
#include<math.h>
#include<stdio.h>
int main()
{
double a,b,c,d,e,f,g,pi,aa,bb,cc,ccc,dd,ddd,ee,ff,gg,qi,zon,o,w,v;
printf("内球面直径:\n");
scanf("%lf",&a);
printf("球心距:\n");
scanf("%lf",&b);
printf("长度:\n");
scanf("%lf",&c);
printf("大内孔:\n");
scanf("%lf",&d);
printf("小内孔:\n");
scanf("%lf",&e);
printf("大外圆:\n");
scanf("%lf",&f);
printf("R角:\n");
scanf("%lf",&g);
pi=3.1416;
dd=d+2.3;
cc=c+4;
ccc=c+1.1;
ee=e+0.4;
qi=b-48+56.84;
zon=b-48+33.15;
ddd=d-3;
ff=f-(g+1)*2;
o=g+1;
v=tan(pi/3.83);
w=(dd-ee)/2/v;
printf("M3 S850 T301 *\n");
printf("G0 X%.1lf M8 *\n",dd);
printf("Z%.0lf *\n",cc);
printf("G1 Z%.1lf F300 *\n",ccc);
printf("X%.1lf W-%.2lf F200 *\n",ee,w);
printf("Z%.2lf F250 *\n",qi);
printf("G3 X50 Z%.2lf R27 F230 *\n",zon);
printf("G0 S900 T302 Z%.0lf U2 *\n",cc);
printf("G0 X%.0lf *\n",ddd);
printf("G1 Z%.0lf F350 *\n",c);
printf("X%.0lf F200 *\n",ff);
printf("G3 X%.0lf W-%.1lf R%.1lf F180 *\n",f,o,o);
printf("G0 W170 M5 *\n");
printf("M9 *\n");
printf("M30 *\n");
getch();
}
|
|