enum用法实例C++
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 11:01:40
enum用法实例C++
帮忙写一个.
————————————————————————————
Key in a time of hour randomly,print good morning/noon/afternoon/evening/night respectively.
Requirement:use Enumeration constant.
Note that the roughly partition of a day is as follow:
1)Morning:The first or early part of the day,lasting from midnight to noon or from sunrise to noon.Six o'clock could be the start of the interval.
2)Noon:Twelve o'clock in the daytime; midday.
3)Afternoon:The part of day from noon until sunset.Say,after 13 o’clock.
4)Evening:The period of decreasing daylight between afternoon and night,after eighteen o’clock.
5)Night:The period between sunset and sunrise,especially the hours of darkness.To ensure the whole day and night are included,we suggest that it begin at 21 o’clock.
I/O Examples:
8
good morning.
12
good noon.
17
good afternoon.
19
good evening.
22
good night.
-1
the input is invalid.
Note that the input/output must follow the above format.
帮忙写一个.
————————————————————————————
Key in a time of hour randomly,print good morning/noon/afternoon/evening/night respectively.
Requirement:use Enumeration constant.
Note that the roughly partition of a day is as follow:
1)Morning:The first or early part of the day,lasting from midnight to noon or from sunrise to noon.Six o'clock could be the start of the interval.
2)Noon:Twelve o'clock in the daytime; midday.
3)Afternoon:The part of day from noon until sunset.Say,after 13 o’clock.
4)Evening:The period of decreasing daylight between afternoon and night,after eighteen o’clock.
5)Night:The period between sunset and sunrise,especially the hours of darkness.To ensure the whole day and night are included,we suggest that it begin at 21 o’clock.
I/O Examples:
8
good morning.
12
good noon.
17
good afternoon.
19
good evening.
22
good night.
-1
the input is invalid.
Note that the input/output must follow the above format.
C++ Primer 已发送,请注意查收.
enum用法实例C++
谁可以给我解释一下enum tower{a='x',b='y',c='z'};这句话的意思,和enum的用法.
C语言里面%g的具体实例用法,
Objective-C中enum的值这样定义是什么意思
语法在实例中的用法.
combine的用法要有实例
C语言枚举定义函数,如下面typedef enum {NO_STATE_S = 0x00,TOUCH_START,PRE
c语言问题(枚举法)#includevoid main(){enum color {red,yellow,white,b
英语口语中hit的用法和实例
their,then,them的用法,加实例
EXCEL 常用函数的用法及实例.
C# using用法 using(实例化对象){.}