L1-029 是不是太胖了
据说一个人的标准体重应该是其身高(单位:厘米)减去 100、再乘以 0.9 所得到的公斤数。已知市斤的数值是公斤数值的两倍。现给定某人身高,请你计算其标准体重应该是多少?(顺便也悄悄给自己算一下吧……)
输入格式:
输入第一行给出一个正整数H
(100 < H
≤ 300),为某人身高。
输出格式:
在一行中输出对应的标准体重,单位为市斤,保留小数点后 1 位。
输入样例:
tex
169
169
输出样例:
tex
124.2
124.2
Solution:
java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int h = Integer.parseInt(in.readLine());
System.out.printf("%.1f", (h - 100) * 1.8);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int h = Integer.parseInt(in.readLine());
System.out.printf("%.1f", (h - 100) * 1.8);
}
}