Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize time reporting Assistant by integrating MybatisPlus with SpringBoot

Shulou Source: shulou.com Published: 2022-05-31 23:52:27 10月02日 Update

Editor to share with you SpringBoot integration MybatisPlus how to achieve time assistant, I believe that most people do not know much, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!

Problem description

Given the current time, please read it out in English.

Time is expressed by time h and minute m. In English pronunciation, the way to read a time is:

If m is 0, read the tense and then add "o'clock", such as 3:00 as "three o'clock".

If m is not 0, read the tense and then read it separately, such as 5:30 as "five thirty".

The reading of hours and minutes uses the reading of English numbers, in which 020 is read as:

0:zero, 1: one, 2:two, 3:three, 4:four, 5:five, 6:six, 7:seven, 8:eight, 9:nine, 10:ten, 11:eleven, 12:twelve, 13:thirteen, 14:fourteen, 15:fifteen, 16:sixteen, 17:seventeen, 18:eighteen, 19:nineteen, 20:twenty .

Read as thirty,40, read as forty,50, read as fifty.

For numbers greater than 20 and less than 60, read the whole ten first, and then add single digits. For example, 31 is read as "thirty one" when you first read 30 and then add 1.

According to the above rules, 21:54 is read as "twenty one fifty four", 9:07 as "nine seven", and 0:15 as "zero fifteen".

Input format

The input contains two non-negative integers h and m, representing the time and minutes of time. A non-zero number is not preceded by a leading 0. H less than 24 and m less than 60.

Output format

Output time and time in English.

Program list # includeusing namespace std;string str1 [21] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"} String str2 [5] = {"ten", "twenty", "thirty", "forty", "fifty"}; string readTime (int num) {string output;if (num)

Tags: Time pronunciation English numbers articles assistants integration content format input output not much two single digits leading most integers methods moments Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi Apple Redmi Shulou Tech Info