#include <stdio.h>
int main()
{
int age = 15;
int height = 162;
float weight = 82.5;
char sfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
/*%d,%f,%c此类符号在后面会有讲解*/
return 0;
}
为啥要加char?
你的代码可以输出年龄15岁,最后一行你加了一个字母i,不能输出是否为肥胖儿童。我帮你去掉了字母i,你再试试吧。
在学习中,提示帮助同学,我就来了
下面是我在通过时的代码:
#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;
}
#include <stdio.h>
int main()
{
int age = 15;
int height = 162;
float weight = 82.5;
char sfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", sfat);
return 0;
}