慕粉3681565
2016-07-18 11:00
#include
int main() { int age = 15; fioat height = 162; fioat weight = 82.5; char isfat = 'y'; printf("年龄:%d 岁\n", age); printf("身高:%d CM\n", height); printf("体重:%f KG\n", weight); printf("是否属于肥胖儿童:%c\n", isfat); return 0; } 年龄不对??还有头文件错误;最好自己下一个c语言编译器
首先:float的拼写错误;其次:第二个分号要用英文半角格式;最后:输出身高时应使用%f
#include<stdio.h>//头文件不完整
int main()
{
int age = 15;
int height = 162;//整型才对身高是没有小数点的,分号不对.
fioat weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}
#include<stdio.h>//头文件不完整
int main()
{
int age = 15;
int height = 162;//整型才对身高是没有小数点的,分号不对.
fioat weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}#include<stdio.h>//头文件不完整
int main()
{
int age = 15;
int height = 162;//整型才对身高是没有小数点的,分号不对.
fioat weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}#include<stdio.h>//头文件不完整
int main()
{
int age = 15;
int height = 162;//整型才对身高是没有小数点的,分号不对//
fioat weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}
#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);
return 0;
}
是float不是fioat
#include<stdio.h>//头文件不完整 int main() { int age = 15; int height = 162;//整型才对身高是没有小数点的,分号不对. fioat weight = 82.5; char isfat = 'y'; printf("年龄:%d 岁\n", age); printf("身高:%d CM\n", height); printf("体重:%f KG\n", weight); printf("是否属于肥胖儿童:%c\n", isfat); return 0; }
C语言入门
926206 学习 · 20797 问题
相似问题