主题:大家帮个忙!!!
大家帮忙看看这组源代码用什么软件才能运行的了谢谢!!
#include<stdio>
#include<conio>
#include<stdlib>
#include<math>
#define PI 3.1416
void main()
{
float R,r,e,re,Ts,Tr;/*
Name:
Copyright:
Author:
Date: 23-12-09 16:20
Description:
*/
int z1,z2;
float Interval;
int i,j;
double x1,y1,x2,y2;
double s,p,t,x;
FILE *fp1,*fp2;
clrscr();
fp1=fopen("d:\\nsj\\dingzi.txt","wt");
if(!fp1)
{
printf("Cannot open the file,Check and try again");
return;
}
fp2=fopen("d:\\NSJ\\zhuanzi.txt","wt");
if(!fp2)
{
printf("Can not open the file");
return;
}
printf("\n\n\n\n\n\n\t\t\tPlease input all of the parameters\n");
printf("\t\t**************************************************\n");
printf("\t\t\tR=\t\tr=\n");
printf("\t\t\te=\t\tre=\n");
printf("\t\t\tTs=\t\tTr=\n");
printf("\t\t\tz1=\t\tz2=\n");
printf("\t\t**************************************************\n");
printf("\t\t\tInterval=\n");
printf("\t\t**************************************************");
gotoxy(27,9);
scanf("%f",&R);
gotoxy(43,9);
scanf("%f",&r);
gotoxy(27,10);
scanf("%f",&e);
gotoxy(44,10);
scanf("%f",&re);
gotoxy(28,11);
scanf("%f",&Ts);
gotoxy(44,11);
scanf("%f",&Tr);
gotoxy(28,12);
scanf("%d",&z1);
gotoxy(44,12);
scanf("%d",&z2);
gotoxy(34,14);
scanf("%f",&Interval);
j=2*PI*180/(Interval*z1);
if(j%2)
j=j+1;
for(i=0;i<=j/2;i++)
{
t=PI/z1+i*2*PI/(z1*j);
s=atan2(sin(z1*t),(r/e+cos(z1*t)))-t;
x1=(R-r)*sin(t)+e*sin(z2*t)-re*sin(s);
y1=(R-r)*cos(t)-e*cos(z2*t)+re*cos(s);
p=asin(r*sin(s+t)/e)-s;
x=z1*p/(z1-1);
x2=x1*cos(p-x)-y1*sin(p-x)-e*sin(x);
y2=x1*sin(p-x)+y1*cos(p-x)-e*cos(x);
fprintf(fp1,"%8.4lf %8.4lf\n",x1,y1);
fprintf(fp2,"%8.4lf %8.4lf\n",x2,y2);
}
fclose(fp1);
fclose(fp2);
}
#include<stdio>
#include<conio>
#include<stdlib>
#include<math>
#define PI 3.1416
void main()
{
float R,r,e,re,Ts,Tr;/*
Name:
Copyright:
Author:
Date: 23-12-09 16:20
Description:
*/
int z1,z2;
float Interval;
int i,j;
double x1,y1,x2,y2;
double s,p,t,x;
FILE *fp1,*fp2;
clrscr();
fp1=fopen("d:\\nsj\\dingzi.txt","wt");
if(!fp1)
{
printf("Cannot open the file,Check and try again");
return;
}
fp2=fopen("d:\\NSJ\\zhuanzi.txt","wt");
if(!fp2)
{
printf("Can not open the file");
return;
}
printf("\n\n\n\n\n\n\t\t\tPlease input all of the parameters\n");
printf("\t\t**************************************************\n");
printf("\t\t\tR=\t\tr=\n");
printf("\t\t\te=\t\tre=\n");
printf("\t\t\tTs=\t\tTr=\n");
printf("\t\t\tz1=\t\tz2=\n");
printf("\t\t**************************************************\n");
printf("\t\t\tInterval=\n");
printf("\t\t**************************************************");
gotoxy(27,9);
scanf("%f",&R);
gotoxy(43,9);
scanf("%f",&r);
gotoxy(27,10);
scanf("%f",&e);
gotoxy(44,10);
scanf("%f",&re);
gotoxy(28,11);
scanf("%f",&Ts);
gotoxy(44,11);
scanf("%f",&Tr);
gotoxy(28,12);
scanf("%d",&z1);
gotoxy(44,12);
scanf("%d",&z2);
gotoxy(34,14);
scanf("%f",&Interval);
j=2*PI*180/(Interval*z1);
if(j%2)
j=j+1;
for(i=0;i<=j/2;i++)
{
t=PI/z1+i*2*PI/(z1*j);
s=atan2(sin(z1*t),(r/e+cos(z1*t)))-t;
x1=(R-r)*sin(t)+e*sin(z2*t)-re*sin(s);
y1=(R-r)*cos(t)-e*cos(z2*t)+re*cos(s);
p=asin(r*sin(s+t)/e)-s;
x=z1*p/(z1-1);
x2=x1*cos(p-x)-y1*sin(p-x)-e*sin(x);
y2=x1*sin(p-x)+y1*cos(p-x)-e*cos(x);
fprintf(fp1,"%8.4lf %8.4lf\n",x1,y1);
fprintf(fp2,"%8.4lf %8.4lf\n",x2,y2);
}
fclose(fp1);
fclose(fp2);
}