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

23 lines
344 B
C

#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;
}