第四次作业
#include"stdio.h"
#include"math.h"
int main(void)
{
double a,b,z;
printf("Enter a: b:\n");
scanf("%lf%lf",&a,&b);
if(a<=3&&b<5){
z=10;}
else if(a<=3&&b>=5){
z=10+2*b/5;}
else if(a>3&&a<=13&&b<5){
z=10+2*(a-3);}
else if(a>3&&a<=13&&b>=5){
z=10+2*(a-3)+(2*b/5);}![](https://img2018.cnblogs.com/blog/1619595/201904/1619595-20190410195036167-388554327.png)
else if(a>13&&b<5){
z=30+3*(a-13);}
else if(a>13&&b>=5){
z=30+3*(a-13)+2*b/5;}
printf("z=%lf",z);
return 0;
}
#include"math.h"
int main(void)
{
double a,b,z;
printf("Enter a: b:\n");
scanf("%lf%lf",&a,&b);
if(a<=3&&b<5){
z=10;}
else if(a<=3&&b>=5){
z=10+2*b/5;}
else if(a>3&&a<=13&&b<5){
z=10+2*(a-3);}
else if(a>3&&a<=13&&b>=5){
z=10+2*(a-3)+(2*b/5);}
![](https://img2018.cnblogs.com/blog/1619595/201904/1619595-20190410195036167-388554327.png)
else if(a>13&&b<5){
z=30+3*(a-13);}
else if(a>13&&b>=5){
z=30+3*(a-13)+2*b/5;}
printf("z=%lf",z);
return 0;
}
#include"stdio.h"
#include"math.h"
int main(void)
{
double a,b,c,x1,y1,x2,y2,x3,y3,C,S,N;
printf("Enter x1,y1:\n x2,y2:\n x3,y3:\n");
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
a=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
b=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
if(a+b<c||a+c<b||b+c<a)
printf("Impossible");
else
C=a+b+c;![](https://img2018.cnblogs.com/blog/1619595/201904/1619595-20190410200038127-1165556430.png)
N=C/2;
S=sqrt(N*(N-a)*(N-b)*(N-c));
printf("C=%.2lf\n,S=%.2lf\n",C,S);
return 0;
}
#include"math.h"
int main(void)
{
double a,b,c,x1,y1,x2,y2,x3,y3,C,S,N;
printf("Enter x1,y1:\n x2,y2:\n x3,y3:\n");
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
a=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
b=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
if(a+b<c||a+c<b||b+c<a)
printf("Impossible");
else
C=a+b+c;
![](https://img2018.cnblogs.com/blog/1619595/201904/1619595-20190410200038127-1165556430.png)
N=C/2;
S=sqrt(N*(N-a)*(N-b)*(N-c));
printf("C=%.2lf\n,S=%.2lf\n",C,S);
return 0;
}
学习是个不断改善的过程,每个人都要进过不断地改进
才能完善自我,在C语言的学习中不断的尝试才是最重
要的,每一个程序都有不同的编译方法。在每一次的改进
和运行中我都能受益良多,能为以后的编写提供宝贵的经验。