题目内容

请编写程序,自定义方法实现对奇数和偶数的判断。提示:1) 定义一个int类型变量x,该变量的值为5。2) 使用if…else语句对x进行判断,如果是奇数就输出“x是一个奇数”,否则输出“x是偶数”。

查看答案
更多问题

请编写程序,自定义一个方法实现对“1+3+5+7+…+99”的求和功能。提示:1) 使用循环语句实现自然数1~99的遍历。2) 在遍历过程中,判断当前遍历的数是否为奇数,如果是就累加,否则不加。

_______, you would have met him.

A. If you came earlier
B. If you should come earlier
C. Had you come earlier
D. Should you come earlier

__________, the crops would be saved.

A. Could it rain
B. If it had rained
C. If it rained
D. Should it rain

It’s high time we ______ cutting down the rainforest.

A. stopped
B. had to stop
C. shall stop
D. stop

答案查题题库