- 7
- 0
- 约2.45万字
- 约 53页
- 2023-09-17 发布于上海
- 举报
精品文档
Q308.(10 分)第 5 章 实验 2:体型判断。医务工作者经广泛的调查和统计分析,根据身高与体重因素给出了以下按“体指数”进行体型判断的方法。体指数计算公式是:t = w /(h*h)其中:t 是体指数;w 是体重,其单位为千克;h 是身高,其单位为米。根据给
Q308.
(10 分)第 5 章 实验 2:体型判断。
医务工作者经广泛的调查和统计分析,根据身高与体重因素给出了以下按“体指数”进行体型判断的方法。体指数计算公式是:
t = w /(h*h)
其中:t 是体指数;w 是体重,其单位为千克;h 是身高,其单位为米。根据给定的体指数 t 计算公式,可判断你的体重属于何种类型:
当 t18 时,为低体重;
当 18≤t25 时,为正常体重;
当 25≤t27 时,为超重体重;
当 t≥27 时,为肥胖。
****输入提示信息格式:Please enter h,w:\n
****输入数据格式要求:%f,%f(先读入身高,再读入体重,身高以米读入, 体重以千克读入)
****输出数据格式要求:
当 t18 时,输出:Lower weight!\n
当 18≤t25 时,输出:Standard weight!\n
当 25≤t27 时,输出:Higher weight!\n
当 t≥27 时, 输出:Too fat!\n
#include stdio.h #include stdlib.h
main()
{
.
精品文档
float t,w,h;
printf(Please enter h,w:\n);
scanf(%f,%f,h,w);
t = w/(h*h);
if(t18)
printf(Lower weight!\n);
else if(t=18t25) printf(Standard weight!\n);
else if(t=25t27) printf(Higher weight!\n);
else
printf(Too fat!\n);
return 0;
}
.
精品文档
Q586.(10 分)编写一个程序,输入年份和月份,判断该年是否是闰年,并根据给出的月
Q586.
(
10 分)编写一个程序,输入年份和月份,判断该年是否是闰年,并根据给出的月份判断是什么季节和该月有多少天?(闰年的条件是年份能被 4 整除但不能被100 整除,或者能被 400 整除;规定 3~5 月为春季,6~8 月为夏季,9~11 月为秋季,1、2 和 12 月为冬季)。
**输入格式要求:%d,%d 提示信息:Please enter year,month:
**输出格式要求:%d is leap year\n %d is not leap year\n The season is spring/summer/autumn/winter The number of days of this month is %d\n
程序运行示例如下:
实例 1:
Please enter year,month:2012,11
2012 is leap year
The season is autumn
The number of days of this month
is
30
实例 2:
Please enter year,month:2013,12
2013 is not leap year
The season is winter
The number of days of this month
is
31
#include stdio.h
#include stdlib.h
main()
{
.
精品文档
int year=0,leap=0,mon=0,day=0;
printf(Please enter year,month:); scanf(%d,%d,year,mon);
if((year%100!=0year%4==0)||(year%100==0year%400==0)){ printf(%d is leap year\n,year);
leap=1;
}
else
printf(%d is not leap year\n,year);
switch(mon)
{
case 1:
case 2:
case 12:printf(The season is winter\n); break;
case 3:
case 4:
case 5:printf(The season is spring\n); break;
.
精品文档
case 6:
case 7:
case 8:printf(The season is summer\n); break;
case 9:
case 10:
case 11:printf(T
您可能关注的文档
- 国际结算试题集及答案.docx
- 国际金融讲义338.docx
- 国际金融双语期末A卷.docx
- 国际金融习题13.docx
- 国际金融学案例20利率互换.docx
- 国际金融学案例31日照电厂的项目融资.docx
- 国际礼仪概论二.docx
- 国际贸易单证实务试卷及答案.docx
- 国际贸易理论的演进逻辑贸易动因.docx
- 国际市场营销作业.docx
- 山西天一大联考2025-2026学年高二上学期期末学情监测语文试题(试卷+解析).docx
- 山西忻州部分学校2025-2026学年高一上学期2月质量检测数学试题(人教B版)(试卷+解析).docx
- 山西运城市2025-2026学年高二第一学期期末调研测试数学试题(试卷+解析).docx
- 陕西省榆林市榆阳区2025-2026学年八年级上学期期末地理试题(试卷+解析).docx
- 陕西西安市碑林区2025-2026学年度第一学期期末八年级生物试题(试卷+解析).docx
- 四川省广元市苍溪县2025-2026年八年级上学期期末道德与法治试题(试卷+解析).docx
- 江苏泰州市姜堰区2025-2026学年七年级上学期1月期末数学试题(试卷+解析).docx
- 江苏省扬州市邗江区2025-2026学年九年级上学期期末考试化学试题(试卷+解析).docx
- 江西上饶市铅山县2025-2026学年第一学期期末考试八年级数学试题(试卷+解析).docx
- 江苏扬州市高邮市2025-2026学年度第一学期期末学业质量监测试题九年级英语(试卷+解析).docx
最近下载
- 2025(人教版)数学六年级下册全册教学设计.docx
- API 682-2014 离心泵和转子泵用轴封系统 第四版(中文).pdf
- 华东师大版八年级数学上册《14.2.3容易误导读者的统计图》同步练习题及答案.docx VIP
- 《从零开始学低压电工技术》,张伯虎,高清版.pdf
- 2026京东智能产发股份有限公司招股说明书.pdf VIP
- 基于交通静化理论的威海市环海路部分路段的优化设计--本科生毕业论文(设计).doc VIP
- 一年级数学20以内破十法减法练习题.pdf VIP
- 一年级数学20以内加减法(凑十法、破十法)专项练习.pdf VIP
- 云南省专业技 职称申报评审表(完整.pdf
- 20以内凑十法专项练习.pdf VIP
原创力文档

文档评论(0)