c语言编程题,求大神解答(用if...else格式)?

2025-03-26 00:30:39
推荐回答(1个)
回答1:

float x,y;
scanf(%f,&x);
if(x<=0.0) y=2.0*x;
else y=x*x;
printf("%5.2f",y);