#T6134. Boiling Water

0
    ID: 1055 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>6134选择结构Junior(初级组)CCC 2021简单

Boiling Water

Boiling Water

题目描述

At sea level, atmospheric pressure is 100 kPa and water begins to boil at 100◦C. As you go above sea level, atmospheric pressure decreases, and water boils at lower temperatures. As you go below sea level, atmospheric pressure increases, and water boils at higher temperatures. A formula relating atmospheric pressure to the temperature at which water begins to boil is ::: hljs-center

P = 5 × B − 400

:::

where P is atmospheric pressure measured in kPa, and B is the temperature at which water begins to boil measured in ◦C. Given the temperature at which water begins to boil, determine atmospheric pressure. Also determine if you are below sea level, at sea level, or above sea level. Note that the science of this problem is generally correct but the values of 100◦C and 100 kPa are approximate and the formula is a simplification of the exact relationship between water’s boiling point and atmospheric pressure.

在海平面,大气压力为100千帕,水在100时开始沸腾◦C.当你到达海平面以上时,大气压力降低,水在较低的温度下沸腾。当你进入海平面以下时,大气压力增加,水在更高的温度下沸腾。一个将大气压力与水开始沸腾的温度联系起来的公式是 ::: hljs-center

P = 5 × B − 400

::: 使用公式后,我们必须打印 P 的值。 然后,根据以下条件,我们要判断我们是低于海平面、处于海平面还是高于海平面。 条件: 如果大气压小于 100 kPa,那么我们就在海平面以上。所以我们将打印 1 如果大气压力为 100 kPa,则我们处于海平面。所以我们将打印 0 如果大气压力大于 100,那么我们就在海平面以上。所以我们将打印 -1

输入格式

The input is one line containing an integer B where B ≥ 80 and B ≤ 200. This represents the temperature in ◦C at which water begins to boil.

输入是包含整数B的一行,其中B≥80且B≤200。这表示◦水开始沸腾的温度。

输出格式

The output is two lines. The first line must contain an integer which is atmospheric pressure measured in kPa. The second line must contain the integer -1, 0, or 1. This integer represents whether you are below sea level, at sea level, or above sea level, respectively.

输出是两行。第一行必须包含一个大气压整数 测量单位为kPa。第二行必须包含整数-1、0或1。此整数表示 无论你是在海平面以下,还是在海平面以上。

99
95
1
102
110
-1

提示

#### 数据范围与提示 Explanation of Output for Sample Input 1 When B = 99, we can substitute into the formula and get P = 5 × 99 − 400 which equals 95. Since 95 kPa is less than 100 kPa, you are above sea level.

Explanation of Output for Sample Input 2 When B = 102, we can substitute into the formula and get P = 5 × 102 − 400 which equals 110. Since 110 kPa is greater than 100 kPa, you are below sea level.

来源

童程童美