• 2021-04-14
    从键盘输入一个数给浮点型变量x,然后输出该数的绝对值y。
    #include "stdio.h"
    main()
    { float x,y;
    scanf("%f", (1) );
    if(x<0) y=-x;
    (2) y=x;
    printf("%f\n", y);
    }