Skip to content

Commit d4c3d22

Browse files
committed
Create 1613A-LongComparison.cpp
1 parent b6de1e7 commit d4c3d22

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

1613A-LongComparison.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <cstdio>
2+
typedef long long ll;
3+
4+
int main(){
5+
6+
ll t; scanf("%lld", &t);
7+
while(t--){
8+
ll x, r; scanf("%lld %lld", &x, &r);
9+
ll y, s; scanf("%lld %lld", &y, &s);
10+
11+
ll u(r), tx(x); while(tx){tx /= 10; ++u;}
12+
ll v(s), ty(y); while(ty){ty /= 10; ++v;}
13+
if(u < v){puts("<");}
14+
else if(u > v){puts(">");}
15+
else{
16+
while(r < s){y *= 10; --s;}
17+
while(s < r){x *= 10; --r;}
18+
if(x < y){puts("<");}
19+
else if(x > y){puts(">");}
20+
else if(x == y){puts("=");}
21+
}
22+
}
23+
24+
}

0 commit comments

Comments
 (0)