小明今年15歲,身高只有162CM,可是體重已經有82.5公斤了,小明是否屬于肥胖兒童呢?我們如何用程序描述這個情形呢?
#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;???
}
2017-12-01
#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;????