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
23 lines
384 B
3 years ago
|
#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);
|
||
|
}
|