作业四
#include<stdio.h>
int main(void)
{
int x,y,z,w;
printf("Enter x,y");
scanf("%d%d",&x,&y);
if(x<=3)
z=10;
else if(x>3&&x<=13)
z=2*x+4;
else
z=3*x-9;
if(y<5)
w=z;
else
w=z+(y/5)*2;
printf("w=%d\n,z=%d\n",z,w);
return 0;
}
int main(void)
{
int x,y,z,w;
printf("Enter x,y");
scanf("%d%d",&x,&y);
if(x<=3)
z=10;
else if(x>3&&x<=13)
z=2*x+4;
else
z=3*x-9;
if(y<5)
w=z;
else
w=z+(y/5)*2;
printf("w=%d\n,z=%d\n",z,w);
return 0;
}
#include<stdio.h>
int main()
{
int m,t,c;
scanf("%d%d",&m,&t);
c=0;
m=m+t/5;
if(m<=3)
c=10;
else if(m<=13)
c=10+(m-3)*2;
else
c=10+(m-3)*2+(m-13)*3;
printf("所用车费c=%d\n",c);
return 0;
}
int main()
{
int m,t,c;
scanf("%d%d",&m,&t);
c=0;
m=m+t/5;
if(m<=3)
c=10;
else if(m<=13)
c=10+(m-3)*2;
else
c=10+(m-3)*2+(m-13)*3;
printf("所用车费c=%d\n",c);
return 0;
}