A = B?
Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 47896 accepted submission (s): 7324
Problem descriptiongive you two numbers A and B, if A is equal to B, you shoshould print "yes", or print "no ".
Inputeach test case contains two numbers A and B.
Outputfor each case, if A is equal to B, you shoshould print "yes", or print "no ".
Sample Input
1 22 23 34 3
Sample output
NOYESYESNO
Author8600 & xhd
Source celebration Cup warm up
Recommendlinle note: the amount is not easy to write in C, so it is really hard to figure out the pointer problem. Recently, the biginteger used in Java orz didn't take into account the decimal point issue. Direct wa, later, I changed it to string, which is similar to biginteger, and WA (data such as 2.10 and 2.100 cannot be replaced by string). Finally, I changed it to bigdecimal (equivalent to a floating point in C)
However, recently, I feel like I am a Java developer and a C ++ developer. I despise myself !!! I can't write data in C ++, but now it's just the time to lay the foundation ~~~ Java is such a powerful language, but it is used by me to toss these undesirable things. Apply
Java method. Although Java writes high precision and large data, it is imperative to use C ++ for AC.
Accepted |
2054 |
250 ms |
3800 K |
374 B |
Java |
import java.util.*;import java.math.*;public class Main { public static void main(String args[]) { BigDecimal a,b; Scanner cin = new Scanner(System.in); while(cin.hasNextBigDecimal()) { a = cin.nextBigDecimal(); b = cin.nextBigDecimal(); if(a.compareTo(b) == 0) System.out.println("YES"); else System.out.println("NO"); } }}