#includeint main() { float x; while(scanf("%f",&x)) { if(x<0) { x = -x; } printf("%.2fn",x); } return 0; }
题目要求输出有两位小数的浮点数,故定义x的类型为float,而非int

#includeint main() { float x; while(scanf("%f",&x)) { if(x<0) { x = -x; } printf("%.2fn",x); } return 0; }
题目要求输出有两位小数的浮点数,故定义x的类型为float,而非int