题意:
输入x, a, y, b, 求 和
的大小比较

题目链接:
https://ac.nowcoder.com/acm/contest/881/J
题解:

AC_code:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll x, y, a, b;
while(cin>>x>>a>>y>>b) {
ll xx = x/a;
ll yy = y/b;
if(xx > yy) {
puts(">");
} else if(xx < yy) {
puts("<");
} else {
xx = x % a * b;
yy = y % b * a;
if(xx > yy) {
puts(">");
} else if(xx < yy) {
puts("<");
}else {
puts("=");
}
}
}
}

本文介绍了一种通过编程方式解决数学问题的方法:比较两个数分别除以其给定倍数后的大小关系。采用C++语言实现,适用于算法竞赛或快速解决问题的需求。
 J Fraction Comparision 【签到题】&spm=1001.2101.3001.5002&articleId=96482990&d=1&t=3&u=c7c28ad90b9a46d5b0cec939f3b108eb)
9775

被折叠的 条评论
为什么被折叠?



