C语言萌新求教
本人土建技术员,对编程感兴趣现在自学C语言,刚学3天,想编一个最简单的通过输入身高体重计算身材标准的程序,下面是我的代码:#include <stdio.h>
int main()
{
int tall;
int weight;
int balance;
printf ("请输入你的身高(cm):\n");
scanf("%d",&tall);
printf ("请输入你的体重(kg):\n");
scanf ("%d",&weight);
balance=(tall-100)*0.9;
printf("你的体重标准值应为:\n");
printf("%d",balance);
if(weigth>balance)
{
printf("超重\n");
}
if(weight<balance)
{
printf("偏瘦\n");
}
if(weight==balance)
{
printf("标准身材\n");
}
return 0;
}
显示错误的地方为,[Error] 'weigth' was not declared in this scope,求大神赐教错误在娜里,应该怎么修改?