【C语言】scanf()输入浮点型数据

#include<stdio.h>
int main()
{
    double x1, x2, x3, x4;
    printf("输入2个浮点数x1,x2:\n");
    scanf_s("%lf,%lf", &x1, &x2);
    printf("%lf,%lf\n", x1, x2);
    printf("输入浮点数x3,x4:\n");
    scanf_s("%5lf,%lf", &x3, &x4);
    printf("%lf,%lf\n");
    return 0;
 

}

猜你喜欢

转载自www.cnblogs.com/HGNET/p/11827979.html