c/c++课的作业合集,都是很简单的文件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
384 B

#include <stdio.h>
#define PI 3.1415926
int main() {
double x = 0.0, y = 0.0, z = 0.0;
scanf("%lf", &x);
if (x <= 2.5) {
y = x*x - 1;
} else {
y = x*x - 1;
}
if (x < 0) {
z = -PI/2.0 + 3.0;
} else if (x == 0) {
z = 0;
} else {
z = PI/2.0 - 5.0;
}
printf("y=%lf, z=%lf", y, z);
}