| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 227 人关注过本帖
标题:[求助]为啥这代码在编译时显示许多变量没定义
只看楼主 加入收藏
zsx369530691
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-10-13
收藏
 问题点数:0 回复次数:0 
[求助]为啥这代码在编译时显示许多变量没定义

#include<math.h>
main()
{
char sex;
char sports;
char diet;

float myHeight;
float faHeight;
float moHeight;
printf("Are you a boy(M) or a girl(F)?");
scanf("% c", &sex);
printf("please input your father's height(cm):");
scanf("%f", &faHeight);
printf("please input your mother's height(cm):");
scanf("%f",&moHeight);
printf("DO you have a good habit of diet(Y/N)?");
scanf("%c",&diet);

printf("do you like sports(Y/N)?");
scanf("%c",&sports);
if(sex ==`M` || sex ==`m`)
myheight = (faHeight + moHeight)*0.54;
else
myheight = (faHeight *0.923 +moHeight) / 2.0;
if(sports == `y` || sports ==`Y`)
myHeight =myHeight * (1 + 0.02);
if(diet ==`Y` || diert ==`y`)
myHeight = myHeight * (1 + 0.015);
printf("your future height will be %f(cm)\n",myHeight);

}

搜索更多相关主题的帖子: 变量 定义 编译 代码 
2007-10-20 17:01
快速回复:[求助]为啥这代码在编译时显示许多变量没定义
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020742 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved