标题:求高手指点迷津,可否帮忙检查一下,怎么输不出来呀
取消只看楼主
羽墨离殇
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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-364725-1-1.html




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

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