#include<stdio.h> void main() {float x,y; printf("请输入x的值:\n"); scanf("%f",&x); printf("%f\n",x); if (x<1) y=x; else if (x<10) y=2*x-1; else if (x>=10) y=3*x-1; printf("%f\n",y); }
Double click to view unformatted code.