今天是打牛客的第一天,也是自己大一的第一次,自己很菜,签到要签很久,但是也在一步步进步,跟随大佬的脚步,只愿我归来仍是少年。 题目: 有两个分数,比较两个的大小,用到大数,自己是第一次,加油吧 AC的大佬代码:#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll x,a,y,b; ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); while(cin>>x>>a>>y>>b) { if(x/a>y/b) cout<<">"<<endl; else if(x/a<y/b) cout<<"<"<<endl; else { if((x%a)*b<(y%b)*a) cout<<"<"<<endl; else if((x%a)*b>(y%b)*a) cout<<">"<<endl; else if((x%a)*b==(y%b)*a) cout<<"="<<endl; } } }