#include <stdio.h>
int main(void)
{
float x;
printf("Please input the value of x :");
while (scanf("%f", &x)) {
if (x < 5)
printf("y = %g\n", x - 9);
else if (x >= 5 && x < 15)
printf("y = %g\n", 5 * x - 3);
else
printf("y = %g\n", 6 * x + 9);
printf("Please input the value of x :");
}
printf("Done!\n");
return 0;
}
int main() {
int x, y;
// printf{"please input one numble!\n"};
scanf("%d", &x);
if (x < 5) {
y = x - 9;
} else if (x < 15) {
y = 5 * x - 3;
} else {
y = 6 * x - 3;
}
登录后提交答案