Test instructions: Determine whether two large numbers are equal.
Import Java.util.scanner;public class Main {public static void main (string[] args) {Scanner sc = new Scanner (system.in); WH Ile (Sc.hasnext ()) {String a = Sc.next (); String B = Sc.next (); a = Sweepzeroandblock (a); b = Sweepzeroandblock (b); Boolean flag = True;if (a.length () = = B.length ()) { for (int i = 0; i < a.length (); i++) {if (A.charat (i)! = B.charat (i)) {flag = False;break;}}} else {flag = false;} if (flag) {System.out.println ("yes"),} else {System.out.println ("NO");}}} Remove the useless 0 in the S string and the blank private static string Sweepzeroandblock (string s) {s = S.trim ();//Remove the unused space behind int i = S.indexof ("."); StringBuffer temp = new StringBuffer ();//Do not use this Hyper memory if (i > 0) {//is a decimal int len = i-1;//If there is no value after the decimal point then the decimal point does not have a for (int j = S. Length ()-1; J > i; j--) {Char ch = s.charat (j); if (ch >= ' 1 ' && ch <= ' 9 ') {len = J;break;}} Copy useful data from string s to temp for (int j = 0; J <= Len; j + +) {Temp.append (S.charat (j));} s = temp.tostring ();} return s;}}
A = = B?Time
limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 73637 Accepted Submission (s): 11627
Problem descriptiongive You both numbers A and B, if A is equal to B, you should print, or print "NO". Give you two numbers a and B, if a=b, you should output "YES", no output "no". (A and B are large numbers, the general data type is not fit)
Inputeach test Case contains-numbers A and B.
The input contains more than one test data, and each row has two numbers.
Outputfor each case, if A was equal to B, you should print "YES", or print "NO". For each test event, you should output Yes and no output "no".
Sample Input
1 22 23) 34 3
Sample Output
Noyesyesno
Author8600 && XHD
Source Celebration Cup warm up
Hdu 2054 A = = B?