#include<stdio.h>
int main(void)
{
int z;
double m,y,s;
printf("Enter z,s:");
scanf("%d%lf",&z,&s);
if(s<=3){
m=10;
}
else
if(s<=10){
m=10+(s-3)*2;
}
else{
m=24+(s-10)*3;
}
if(z%5==0){
y=m+(z/5)*2;}
else
y=m;
printf("y=%.0lf",y);
return 0;
}
2》
#include<stdio.h>#include<math.h>
int main(void)
{
double x1,x2,x3,y1,y2,y3,a,b,c,C,A;
printf("Enter x1,x2,x3,y1,y2,y3");
scanf("%lf%lf%lf%lf%lf%lf",&x1,&x2,&x3,&y1,&y2,&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)){
C=a+b+c;
A=sqrt((C/2)-a)*((C/2)-b)*((C/2)-c);
printf("A=%.2lf,C=%.2lf",A,C);
}
else
printf("impossible");
return 0; }
}