can any one tell me that what is wrong in my code is wrong (((educational round 118 problem a))

Правка en1, от abhimanyu_sahrawat, 2021-12-01 22:52:58

import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { double x1=sc.nextDouble(); double p1= sc.nextDouble(); double x2= sc.nextDouble(); double p2=sc.nextDouble(); double mulx1=0; double mulx2=0;

if (x1==0){
           x1=1;
       } else {
           x1=x1;
       }
       if (x2==0){
           x2=1;
       }else {
           x2=x2;
       }
       if (p1>0){
            mulx1=x1*Math.pow(10,p1);
        }else {
            mulx1=x1*1;

        }

        if (p2>0){
            mulx2=x2*Math.pow(10,p2);
        }else {
            mulx2=x2*1;
        }
        if (mulx1>mulx2)
            System.out.println(">");
        else if (mulx1<mulx2)
            System.out.println("<");
        else if (mulx1== mulx2)
            System.out.println("=");

    }


}

}

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский abhimanyu_sahrawat 2021-12-01 22:52:58 1243 Initial revision (published)