|
楼主 |
发表于 2015-5-16 17:25:46
|
显示全部楼层
还是不行呀,大神们帮改下代码可以么
#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,q,qq,
qirx,qirz,zonrx,zonrz,xierx,xierz,k,l,m,n;
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||t",&g); //判断这里输入的是字母C还是十进制数
pi=3.1416;
dd=d+2;
cc=c+4;
ccc=c+1.1;
ee=e+0.35;
qi=b-38+48.72;
zon=b-38+20.5;
ddd=d-3;
ff=f-(g+1)*2;
o=g+1;
v=tan(pi/3.83);
w=(dd-ee)/2/v;
q=ccc-w-qi;
m=l+1.2;
qirx=k-l/tan((n+90)/2*pi/180)*2-2.4;
zonrx=k+(sin(n*pi/180))*(l/tan((n+90)/2*pi/180)*2)-(1.2-(cos(n*pi/180)*1.2))*2;
zonrz=cos(n*pi/180)*l/tan((n+90)/2*pi/180)-sin(n*pi/180)*1.2+1.2;
xierx=f;
xierz=c-((f-k)/2/tan(n*pi/180)+1.2);
if(b<=58)qq=58-b;
if(b>58)qq=78-b;
printf("O645\n");
printf("X%.1lf\n",dd);
printf("Z%.1lf\n",cc);
printf("Z%.1lf\n",ccc);
printf("W-%.2lf\n",w);
printf("Z%.2lf\n",qi);
printf("Z%.2lf\n",zon);
printf("Z%.1lf\n",cc);
printf("X%.1lf\n",ddd);
printf("Z%.1lf\n",c);
printf("X%.1lf\n",ff); //如果输入是数字按这三行及有汉字的最后两行打印
printf("X%.1lf W-%.1lf R%.1lf\n",f,o,o);
printf("x%.2lf\n",qirx);
printf("角度:\n"); //如果输入的是字母C按这四行打印
scanf("%lf",&n);
printf("倒角下方外圆:\n");
scanf("%lf",&k);
printf("x%.2lf\n",qirx); //输入的是字母C继续输入上面两个数据后打印出下面内容
printf("G3 x%.2lf w-%.2lf R%.2lf\n",zonrx,zonrz,m);
printf("G1 x%.2lf z%.2lf\n",xierx,xierz);
printf("过渡=%.2lf\n",q);
printf("打表垫片=%.1lf\n",qq);
getch();
}
|
|