<pre class="cpp" name="code">一问题及代码
上机内容:编写四个简单c++程序
上机目的:提高c++技巧
/*
02.文件名称:求体重是否健康
03.作者:安佳航
04.完成日期:2016年3月25日
05.版本号:1.0
06.输入描述:身高及体重
07.问题描述:第二次编程,符号出错
08.输出描述:体重是否正常
09.*/
#include<iostream.h>
void main()
{
double weight,height,standardweight;
cout<<"请输入身高,单位厘米"<<endl;
cin>>height;
cout<<"请输入体重,单位公斤"<<endl;
cin>>weight;
standardweight=height-100;
if(weight>standardweight&&1.2*standardweight<weight)
cout<<"超重"<<endl;
else if(weight<standardweight&&1.2*weight<standardweight)
cout<<"太瘦"<<endl;
else
cout<<"正常"<<endl;
}
二,运行结果
三,心得体会
编程需要耐心和细心,编写代码时要注意单词的错写和符号的大小写。
四,知识点总结
int 输入的值为整数,double为小数
cout后面是《
cin后面是》