思路:判断语句,小于0加符号,大于0直接输出
#include <stdio.h>#include <stdlib.h>
int main(){ double a; while(scanf("%lf",&a)!=EOF) { if(a<0) a=-a; printf("%.2lf ",a); }
return 0;}