//用了点强制类型转换 #include <stdio.h> int main() { float weight; char a; scanf("%f %c", &weight, &a); if (weight > 1 && a == 'y') { if (weight - 1 - (int)(weight - 1) < 1&&weight - 1 - (int)(weight - 1) >0) printf("%d", (int)(weight - 1) + 26); else printf("%d", (int)(weight - 1) + 25); } else if (weight <= 1 && a == 'y') printf("25"); else if (weight > 1 && a == 'n') { if (weight - 1 - (int)(weight - 1) < 1&&weight - 1 - (int)(weight - 1) >0) printf("%d", (int)(weight - 1) + 21); else printf("%d", (int)(weight - 1) + 20); } else if (weight <= 1 && a == 'n') printf("20"); return 0; }