import java.util.Scanner;
public class oioio{
public static void main(String[]argv){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
double num=sc.nextDouble();
System.out.printf("|%.4f|=%.4f\n",Math.abs(num),num);
}
}
}
自己測都是正確的但測出來他說我的答案是
|100.0570|=-100.0570
求救
import java.util.Scanner;
public class oioio{
public static void main(String[]argv){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
double num=sc.nextDouble();
System.out.printf("|%.4f|=%.4f\n",Math.abs(num),num);
}
}
}
自己測都是正確的但測出來他說我的答案是
|100.0570|=-100.0570
求救
沒事了... 把輸出對調就好了