第二周项目3 就拿胖子说事

来源:互联网 发布:网络远程控制门禁系统 编辑:程序博客网 时间:2024/05/20 21:21
/*  *Copyright(c) 2016,烟台大学计算机学院  *All rights reserved.  *文件名称:test2.cpp  *作    者:刘金石  *完成日期:2016年3月11日  *版本  号:v1.0  *问题描述:就拿胖子说事。 *输入描述:输入身高体重 *输出描述:输出体重状态*/  #include<iostream>using namespace std;int main(){    float high,weight,temp;    cout<<"请输入身高(cm)体重(kg):"<<endl;    cin>>high>>weight;    temp=(high-100)/weight;    if(temp<=0.8)        cout<<"超重!"<<endl;    else if(temp<1.2&&temp>0.8)        cout<<"正常!"<<endl;    else if(temp>=1.2)        cout<<"超轻!"<<endl;    return 0;}
运行结果:
0 0
原创粉丝点击