1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 14:36:19 +00:00
202401-programming-assignments/【实践课外】4.循环结构1/7-4 最佳情侣身高差.c

23 lines
344 B
C
Raw Normal View History

2024-10-25 08:43:54 +00:00
#include <stdio.h>
int main() {
int n;
scanf("%d\n", &n);
for (int i = 1; i <= n; i++) {
char c;
double h;
scanf("%c %lf\n", &c, &h);
if (c == 'M') {
printf("%.2lf\n", h / 1.09);
} else { // c == 'F'
printf("%.2lf\n", h * 1.09);
}
}
return 0;
}