遞迴_第幾象限
user_3763047219
c_cpp
3 years ago
519 B
10
Indexable
#include <stdio.h>
#include <stdlib.h>
typedef struct point_t point_t;
struct point_t {
double x;
double y;
};
int main() {
struct point_t p;
scanf("%lf %lf", &p.x, &p.y);
if (p.x > 0) {
if (p.y > 0) {
printf("第一象限");
}
else {
printf("第四象限");
}
}
else {
if (p.y > 0) {
printf("第二象限");
}
else {
printf("第三象限");
}
}
}Editor is loading...