There are two integer variables in our program, hours and days, which represents time. If in the program, we increase the number of hours by one, which of the following lines of code will correctly update days and hours? 我们的程序中有两个整型变量,hours 和 days,它们代表时间。如果在程序中,我们将小时数增加 1,以下哪一行代码可以正确更新 days 和 hours?单项选择题

A

hours = hours % 24;

B

days = days + hours / 24; hours = hours % 24;

C

days = days + hours / 24;

D

days = days + hours % 24; hours = hours / 24;

E

hours = hours + days % 24;

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!