@[Kevinyyds](/user/555780) 改成 ```1.00*a/b``` 试试
by Yopoui @ 2022-08-15 09:12:56
或者全部用```double```,直接除,比较
by Yopoui @ 2022-08-15 09:28:07
https://www.luogu.com.cn/record/83840509
```cpp
#include<bits/stdc++.h>
using namespace std;
double n,a,b,x,y,c,z;
int main()
{
cin>>n;
cin>>x>>y;
z=1.00*x/y;
for(int i=2;i<=n;i++)
{
cin>>a>>b;
c=1.00*a/b;
if(z-c>0.05)
cout<<"better"<<endl;
else
if(c-z>0.05)
cout<<"worse"<<endl;
else
cout<<"same"<<endl;
}
return 0;
}
```
还是老样子
by Kevinyyds @ 2022-08-15 11:01:21
https://www.luogu.com.cn/record/100412654#:~:text=15%3A33%3A53-,%E6%B5%8B%E8%AF%95%E7%82%B9%E4%BF%A1%E6%81%AF,Accepted%2C%20%E5%BE%97%E5%88%86%2010.ok%20accepted,-%E5%9C%A8%E6%B4%9B%E8%B0%B7
你这样改就可以了!!!
```c
#include<bits/stdc++.h>
using namespace std;
double n,a,b,x,y,c,z;
int main()
{
cin>>n;
cin>>x>>y;
z=y/x;
for(int i=2;i<=n;i++)
{
cin>>a>>b;
c=b/a;
if(c-z>0.05)
cout<<"better"<<endl;
else
if(z-c>0.05)
cout<<"worse"<<endl;
else
cout<<"same"<<endl;
}
return 0;
}
```
by kuikuidadi @ 2023-01-23 15:37:14