问答详情
源自:2-4 基本数据类型

错误在哪?

#include <stdio.h>

int main()

{

    int age = 15;

    long height = 162;

    float weight = 82.5;

    isfat = 'y';

    printf("年龄:%d 岁\n", age);

    printf("身高:%d CM\n", height);

    printf("体重:%f KG\n", weight);

    printf("是否属于肥胖儿童:%c\n", isfat); 

    return 0;    

}


提问者:qq_今朝有酒今朝睡_04346718 2016-11-14 09:33

个回答

  • 刺客6
    2016-11-14 10:12:38

    未定义“isfat”的数据类型;可用“char”来定义数据类型

  • 我是真的小胖子
    2016-11-14 10:08:00

    这个是对的

  • 我是真的小胖子
    2016-11-14 10:07:36

    #include <stdio.h>

    int main()

    {

        int    age = 15;

        int    height = 162;

        double    weight = 82.5;

        char    isfat = 'y';

        printf("年龄:%d 岁\n", age);

        printf("身高:%d CM\n", height);

        printf("体重:%f KG\n", weight);

        printf("是否属于肥胖儿童:%c\n", isfat); 

        /*%d,%f,%c此类符号在后面会有讲解*/

        return 0;    

    }


  • 我是真的小胖子
    2016-11-14 10:06:14

    你先等会