欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 美景 > 十月末补充(?

十月末补充(?

2024/11/29 16:59:14 来源:https://blog.csdn.net/Li_ling_8/article/details/143232616  浏览:    关键词:十月末补充(?

出租车计价:

#include <stdio.h>
int main()
{int x,m,y;double z;scanf("%d",&x);scanf("%d",&m);if(x>0&&x<=3){y=10;}else if((x-3)>0&&(x-3)<=10){y=10+2*(x-3);}else if(x>13){y=3*(x-13)+10+2*10;}else{return 1;}if(m>=5){z=(m/5.0)*2.0;}else{z=0.0;}double fee=y+z;             //注意把z、fee写成double类型的 才好四舍五入printf("%.0f",fee);return 0;
}
/*
#include <stdio.h>int countdigit(int num, int digit);int main() 
{int n;scanf("%d", &n);int count = assistant(n, 2);printf("%d", count);return 0;
}int digit(int num, int digit) 
{int count = 0;if (num == 0 && digit == 0) {return 1; }while (num > 0) {int last = num % 10;if (last == digit) {count++;}num /= 10; }return count;
}
*//*
#include <stdio.h>double real,imag;    //全局变量
void prod(double real1,double imag1,double real2,double imag2);
void add(double real1,double imag1,double real2,double imag2);
int main()
{double real1,real2,imag1,imag2;scanf("%lf %lf",&real1,&imag1);scanf("%lf %lf",&real2,&imag2);add(real1,imag1,real2,imag2);printf("%.2f+%.2fi\n",real,imag);prod(real1,imag1,real2,imag2);printf("%.2f+%.2fi\n",real,imag);return 0;
}void prod(double real1,double imag1,double real2,double imag2)
{real=real1*real2-imag1*imag2;imag=real1*imag2+real2*imag1;return;
}
void add(double real1,double imag1,double real2,double imag2)
{real=real1+real2;imag=imag1+imag2;return;
}
*//*
#include <stdio.h>
int main()
{int choice;double cash=0.0;double value;void income(double number,double cash),explend(double number,double cash);scanf("%d",&choice);if(choice!=0){if(choice==1||choice==2){scanf("%lf",&value);if(choice==1){income(value);}else{expend(value);}printf("%.2f",cash);scanf("%d",&choice);}else(choice==0){return 1;}}return 0;} void income(double number,double cash)
{return (cash+=number);
}
void explend(double number,double cash)
{return (cash-=number);
}
*//*
#include <stdio.h>
int main()
{char ch;ch=getchar();while(ch!='\n'){if(ch>='A'&&ch<='Z'){ch=ch-'A'+'a';}else if(ch>='a'&&ch<='z'){ch=ch-'a'+'A';}putchar(ch);ch=getchar();}}return 0;
} #include <stdio.h>
int main()
{char ch;while((ch=getchar())!=EOF){if(ch>='A'&&ch<='Z'){ch=ch-'A'+'a';}else if (ch>='a'&&ch<='z'){ch=ch-'a'+'A';}putchar(ch);}}return 0;
} 
*//*
#include <stdio.h>
int main()
{int word,count;char ch;word=count=0;while((ch=getchar())!=EOF){if(ch==' '){word=0;}else if(word==0){word=1;count++;}}printf("%d",count);return 0;
}*/#include <stdio.h>
#include <math.h>double distance(double x1,double x2,double y1,double y2)
{double dist;dist = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));return dist;
}int main()
{double x1,y1,x2,y2;scanf("%lf %lf",&x1,&y1);scanf("%lf %lf",&x2,&y2);double dist=distance(x1,x2,y1,y2);printf("%.2f",dist);return 0;
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com