1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 21:58:41 +00:00
202401-programming-assignments/【实践课外】3.选择结构2/7-2 选择-外卖.c

19 lines
343 B
C
Raw Normal View History

2024-10-23 03:12:50 +00:00
#include <math.h>
#include <stdio.h>
int main() {
double x, y;
scanf("%lf%lf", &x, &y);
if (x <= 0 && y >= 0 || x <= y && y <= 0) {
printf("\\^O^/\n");
} else if (x > y && y <= 0) { // 类似 -0.5 -0.75 的情况
printf("1\n");
} else {
printf("%d\n", (int)ceil(y / x));
}
return 0;
}