您的位置:首页 > 编程语言 > C#

BC#29第一题

2015-07-15 11:58 176 查看
//取对数比较就好了log(ab)=b∗log(a),注意会有精度误差
AC代码:
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#include<math.h>int main(){double a,b,c,d;while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d)!=EOF){double m=b*log(a);double n=d*log(c);if(m-n>1e-10){printf(">\n");}else if(n-m>1e-10){printf("<\n");}else{printf("=\n");}}return 0;}

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: