以下的几个都是我的而且是一个问题,翻译能力有限,帮忙啊
来源:百度知道 编辑:UC知道 时间:2024/05/22 15:57:27
http://zhidao.baidu.com/question/46011919.html
http://zhidao.baidu.com/question/46005524.html
http://zhidao.baidu.com/question/46005732.html
完成的就在80分那上面留个名,好的话我会追加的
谢谢啦
你好,我是http://zhidao.baidu.com/question/46005524.html
这个页面中的 “ 匿名 2-15 15:09 ”用户
原页面写不下了,所以将第6个小题的答案写在这里:
6.写一个程序,从a3_input.txt读取数据,并经过上面的几个函数处理后得到的结果按指定格式输出到a3_output.txt文件中
//---------------------------------------------------------------------------
#include <stdio.h>
#include <math.h>
double degrees_to_radians(double de)
{
const double pi=3.14159265359;
return (de*pi/180);
}
double compute_distance(double x1,double y1,double x2,double y2)
{
return (sqrt(pow(x1-x2,2)+pow(y1-y2,2)));
}
int num_digits_in_base(int x,int b)
{
int c=0;
while (x!=0)
{
c++;
x/=b;
}
return c;
}
int main(void)
{
double w,x,y,z;
int a;
FILE *ifp,*ofp;
ifp=fopen("a3_input.txt","r");