实验一

实验一

代码1

结果1

 

 

 

代码2

 

 

结果2

 

实验二

代码

结果

实验三

代码

 

结果

实验四

代码

结果

实验五

代码


 

#include<stdio.h>
int main()
{
	int year;
	double s;
	s=1000000000;
	year=s/60/60/24/365+0.5;
	printf("等于%d年\n",year);
	return 0;
}

  结果

实验六

代码

#include <stdio.h>
#include <math.h>
int main()
{
double x, ans;
scanf("%lf", &x);
ans = pow(x, 365);
printf("%.2f的365次方: %.2f\n", x, ans);
return 0;
}

结果

代码

#include <stdio.h>
#include <math.h>
int main()
{
    double x, ans;
    while(scanf("%lf", &x) != EOF)
{
    ans = pow(x, 365);
    printf("%.2f的365次方: %.2f\n", x, ans);
    printf("\n");
}
return 0;
}

结果

实验七

代码

#include<stdio.h>
int main()
{
    double c,f;
    while(scanf("%lf",&c)!=EOF)
    {
        f=c*9/5+32;
        printf("摄氏度c=%.2f时,华氏度f=%.2f",c,f);
    }
    return 0;
}

结果

 

实验八

代码

#include<stdio.h>
#include<math.h>
int main()
{
    double a,b,c,s,area;
    while(scanf("%lf %lf %lf",&a,&b,&c)!=EOF)
    {
        s=(a+b+c)/2;
        area=sqrt(s*(s-a)*(s-b)*(s-c));
        printf("a=%g,b=%g,c=%g,area=%.3f",a,b,c,area);
    }
    return 0;
}

结果

 

posted @ 2023-10-06 16:22  陈星我儿  阅读(23)  评论(0)    收藏  举报