| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 391 人关注过本帖
标题:求高手指点迷津,可否帮忙检查一下,怎么输不出来呀
取消只看楼主 加入收藏
羽墨离殇
Rank: 2
等 级:论坛游民
帖 子:13
专家分:11
注 册:2012-3-10
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:0 
求高手指点迷津,可否帮忙检查一下,怎么输不出来呀
#include <stdio.h>
#include <stdlib.h>

int main()
{
    float faHeight,moHeight,yoHeight;
    char sex,sports,diet;
    scanf("%c\n%f\n%f\n%c\n%c",&sex,&faHeight,&moHeight,&sports,&diet);
    if(sex==('M'||'n'))
    {
        yoHeight=(faHeight+moHeight)*0.54;
        if(sports==('Y'||'y'))
        {
             yoHeight*=1+0.02;
             if(diet==('Y'||'y'))
             {
                 yoHeight*=1+0.015;
                 printf("Your future height will be %.0f(cm)\n",yoHeight);
             }
             else
             {
                printf("Your future height will be %.0f(cm)\n",yoHeight);
             }
        }
        else
        {
             if(diet==('Y'||'y'))
            {
                yoHeight*=1+0.015;
                printf("Your future height will be %.0f(cm)\n",yoHeight);
            }
            else
            {
                printf("Your future height will be %.0f(cm)\n",yoHeight);
            }
        }
    }
    else if(sex==('F'||'f'))
{
    yoHeight=(faHeight*0.923+moHeight)/2;
        if(sports==('Y'||'y'))
            {
            yoHeight*=1+0.02;
                if(diet==('Y'||'y'))
                {
                yoHeight*=1+0.015;
                printf("Your future height will be %.0f(cm)\n",yoHeight);
                }
                else
                {
                printf("Your future height will be %.0f(cm)\n",yoHeight);
                }
            }
        else
            {
                if(diet==('Y'||'y'))
                {
                yoHeight*=1+0.015;
                printf("Your future height will be %.0f(cm)\n",yoHeight);
                }
                else
                {
                printf("Your future height will be %.0f(cm)\n",yoHeight);
                }
            }
}

    return 0;
}
搜索更多相关主题的帖子: 检查 include future sports 
2012-03-29 20:41
快速回复:求高手指点迷津,可否帮忙检查一下,怎么输不出来呀
数据加载中...
 
   



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

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