3 条题解

  • 1
    @ 2026-9-16 22:27:32

    根据身高体重判断身材是否标准:

    标准体重 = (身高 - 100) × 0.9

    实际体重 > 标准体重 × 1.1 → 胖(fat)

    实际体重 < 标准体重 × 0.9 → 瘦(thin)

    否则 → 标准(standard) C

    #include<stdio.h>
    
    int main(){
        int height, weight;
        scanf("%d %d", &height, &weight);
        
        double standard = (height - 100) * 0.9;
        
        if(weight > standard * 1.1) {
            printf("fat");
        } else if(weight < standard * 0.9) {
            printf("thin");
        } else {
            printf("standard");
        }
        
        return 0;
    }
    
    
    • 1
      @ 2026-9-14 0:21:00

      python

      height, weight = map(int, input().split())
      standard = (height - 100) * 0.9
      
      if weight > standard * 1.1:
          print("fat")
      elif weight < standard * 0.9:
          print("thin")
      else:
          print("standard")
      
      
      • 0
        @ 2025-9-17 21:10:03
        void eachT() {
            int h,kg;
            cin>>h>>kg;
            double i=(h-100)*0.9;
            if(i*1.1<kg) cout<<"fat";
            else if(kg<i*0.9) cout<<"thin";
            else cout<<"standard";
        }
        
        • 1

        信息

        ID
        10
        时间
        1000ms
        内存
        64MiB
        难度
        8
        标签
        递交数
        251
        已通过
        46
        上传者