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

这个怎么做

#include <stdio.h>
int main()
{
        age = 15;
        height = 162;
        weight = 82.5;
        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;   
}

提问者:慕粉8578495 2018-03-09 18:06

个回答

  • qq_長樂_0
    2018-03-09 23:53:54
    已采纳

    就是 你要认真的看旁边的知识点 整数型就用int 浮点型 也就是带有小数点的用float 然后是一个字母的就用chart

    每次写程序都要进行分类定义变量  

  • 慕函数2757139
    2018-03-09 18:24:31

    #include <stdio.h>
    int main()
    {
          int  age = 15;
           int height = 162;
          float  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;   
    }

  • 慕无忌9941574
    2018-03-09 18:21:53

    int age = 15;
    int height = 162;
    float weight = 82.5;
    char isfat = 'y';