当前位置:网站首页>分數大小的比較
分數大小的比較
2022-06-12 02:56:00 【HENU_Lzey】

#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
long long a,b,x,y,a1,b1;
while(~scanf("%lld %lld %lld %lld",&x,&a,&y,&b)){
if(x/a>y/b){
printf(">\n");
}else if(x/a==y/b){
a1=x%a;
b1=y%b;
if(a1*b>b1*a)printf(">\n");
else if(a1*b==b1*a)printf("=\n");
else if(a1*b<b1*a)printf("<\n");
}else if(x/a<y/b){
printf("<\n");
}
}
return 0;
}
1.數據較大時,用scanf輸入;
2.對於分數的比較大小時先劃成真分數比較實數部分;再比較分數部分
边栏推荐
- Demand and business model innovation - demand 6- stakeholder analysis and hard sampling
- Apache simple honeypot
- Wechat applet project example - renju for two
- Unity3d ugui translucent or linear gradient pictures display abnormally (blurred) problem solving (color space mismatch)
- Force deduction solution summary -04.06 Successor
- Ue4\ue5 touch screen touch event: single finger and double finger
- Graduation design of fire hydrant monitoring system --- thesis (add the most comprehensive hardware circuit design - > driver design - > Alibaba cloud Internet of things construction - > Android App D
- oracle之序列
- Solutions to errors in ROM opening by MAME
- WPS table learning notes - highlight duplicate values
猜你喜欢

errno: -4091, syscall: ‘listen‘, address: ‘::‘, port: 8000

微积分复习2

架构入门讲解 - 谁动了我的蛋糕

How to build urban smart bus travel? Quick code to answer

One article to show you how to understand the harmonyos application on the shelves

Solutions to errors in ROM opening by MAME

如何防止商场电气火灾的发生?

Introduction to program environment and preprocessing C language (advanced level)

Wechat applet project example - renju for two

Application of ankery anti shake electric products in a chemical project in Hebei
随机推荐
Kubernetes' learning path. Is there any "easy mode" Q recommendation for container hybrid cloud
Computer common sense
Force deduction solution summary 473 match to square
Maya foreground rendering plug-in Mel scripting tool
Grafana data visualization
Several common instructions for virsh to create / shut down / stop virtual machines
1 minute to understand the essential difference between low code and zero code
PHP life cycle and swoole life cycle
Demand and business model innovation - demand 10- observation and document review
Selection (044) - what is the output of the following code?
博创智能冲刺科创板:年营收11亿 应收账款账面价值3亿
xml
[digital signal processing] correlation function (power signal | cross correlation function of power signal | autocorrelation function of power signal)
[digital signal processing] correlation function (energy signal | cross correlation function of energy signal | autocorrelation function of energy signal)
Oracle users and tablespaces
(9) Serial port interrupt
Wechat applet project example - I have a paintbrush (painting)
Demand and business model innovation - demand 6- stakeholder analysis and hard sampling
Unity3D中DrawCall、Batches、SetPassCall
微信小程序项目实例——双人五子棋