acm2003

/**

* 求绝对值

*/

import java.util.*;

public class acm2003 {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

while(in.hasNextDouble()){

double a=in.nextDouble();

if(a<0){

a=-a;

System.out.printf("%.2f",a);

System.out.println();

}else{

System.out.printf("%.2f",a);

System.out.println();

}

}

}

}

时间: 2024-10-24 07:09:21

acm2003的相关文章