当前位置 :
enum用法实例C++帮忙写一个.————————————————————————————Keyinatimeofhourrandomly,printgoodmorning/noon/afternoon/evening/nightrespectively.Requirement:useEnumerationconstant.No
 更新时间:2024-04-26 00:35:23
1人问答
问题描述:

enum用法实例C++

帮忙写一个.

————————————————————————————

Keyinatimeofhourrandomly,printgoodmorning/noon/afternoon/evening/nightrespectively.

Requirement:useEnumerationconstant.

Notethattheroughlypartitionofadayisasfollow:

1)Morning:Thefirstorearlypartoftheday,lastingfrommidnighttonoonorfromsunrisetonoon.Sixo'clockcouldbethestartoftheinterval.

2)Noon:Twelveo'clockinthedaytime;midday.

3)Afternoon:Thepartofdayfromnoonuntilsunset.Say,after13o’clock.

4)Evening:Theperiodofdecreasingdaylightbetweenafternoonandnight,aftereighteeno’clock.

5)Night:Theperiodbetweensunsetandsunrise,especiallythehoursofdarkness.Toensurethewholedayandnightareincluded,wesuggestthatitbeginat21o’clock.

I/OExamples:

8

goodmorning.

12

goodnoon.

17

goodafternoon.

19

goodevening.

22

goodnight.

-1

theinputisinvalid.

Notethattheinput/outputmustfollowtheaboveformat.

包晓春回答:
  C++Primer已发送,请注意查收.
最新更新
查询网(025771.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

邮箱:  联系方式:

Copyright©2009-2021 查询网 025771.com 版权所有 闽ICP备18026954号-22