欢迎

控制流语句

自动化评分家庭作业和测试

  • Fork 此仓库
  • 完成任务
  • 提交时带上正确的消息
  • 提交时带上正确的消息

问题

if01

给定三个整数 a, b, c,检查以下语句:“数字 b 在 a 和 c 之间”。

示例 1

Input: a=1
Output: 2

示例 2

Input: a=-5
Output: -5

约束

  • -1018<=num<=1018

if02

如果数字是正数,则增加 1,否则减少 2。

示例 1

Input: a=5
Output: 6

示例 2

Input: a=-1
Output: -3

约束

  • -1018<=num<=1018

if03

如果数字是正数,则增加 1,否则减少 2。如果数字为 0,则赋值为 10。

示例 1

Input: a=-9
Output: -11

示例 2

Input: a=3
Output: 4

约束

  • -1018<=num<=1018

if04

找出给定数字中有多少个正数。

示例 1

Input: a=-2 b=4 c=1
Output: 2

示例 2

Input: a=3 b=-3 c=-6
Output: 1

约束

  • -1018<=num<=1018

if05

找出给定数字中有多少个负数。

示例 1

Input: a=-2 b=4 c=1
Output: 1

示例 2

Input: a=3 b=-3 c=-6
Output: 2

约束

  • -1018<=num<=1018

if06

找出给定数字中有多少个正数和多少个负数。

示例 1

Input: a=-2 b=4 c=1
Output: "there are a lot of positive numbers"

示例 2

Input: a=3 b=-3 c=-6
Output: "there are a lot of negative numbers"

约束

  • -1018<=num<=1018

if07

给定一个整数 a,检查以下条件:“正奇数”、“正偶数”、“负奇数”、“负偶数”、“数字为零”

示例 1

Input: a=57
Output: "positive odd number"

示例 2

Input: a=-24
Output: "negative even number"

约束

  • -109<=num<=109

if08

给定一个整数 a,检查以下条件:“两位数奇数”、“两位数偶数”、“三位数奇数”、“三位数偶数”

示例 1

Input: a=57
Output: "two-digit odd number"

示例 2

Input: a=-242
Output: "three-digit even number"

约束

  • -103 < num < 10 3

if09

The two-digit integer is given.
Replace the digits of the number.
True if the resulting number is less than or equal to the old number, otherwise return False.

示例 1

Input: a=57
Output: False

示例 2

Input: a=21
Output: True

约束

  • -103 < num < 10 3

if10

Display the message according to the following temperature conditions given to you in Celsius:
Temp<0: "Freezing"
Temp 1-10: "Very Cold"
Temp 11-20: "Cold"
Temp 21-30: "Normal"
Temp 31-40: "Hot"
Temp >40: "Very Hot"

示例 1

Input: a=21
Output: "Normal"

示例 2

Input: a=-4
Output: "Freezing

约束

  • -103 < num < 10 3

警告

  • 不要复制其他解决方案或任何解决方案
  • 不要删除注释

GitHub

查看 Github