From 7211fc1ea8bf9982d3a11eddfedb15aa9182b456 Mon Sep 17 00:00:00 2001 From: msksbr Date: Thu, 13 Jun 2024 19:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AD=E5=82=BB=E9=80=BC=E9=99=88=E8=92=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Jun,13th,2024.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/Jun,13th,2024.java diff --git a/test/Jun,13th,2024.java b/test/Jun,13th,2024.java new file mode 100644 index 0000000..8ac408d --- /dev/null +++ b/test/Jun,13th,2024.java @@ -0,0 +1,35 @@ +import java.util.Scanner; +public class Jun,13th,2024{ +public static void main(String args[]){ +Scanner sc=new Scanner(System.in); +System.out.print("enter your height (m) :"); +System.out.println(); +double height=sc.nextDouble(); +System.out.print("enter your weight (kg) :"); +double weight=sc.nextDouble(); +System.out.println(); +if(height>2.5||weight>150){ + System.out.println("please enter a reasonable data"); +} +double bmi=weight/height*height; +if(bmi<18.5){ + +} +else if(bmi>=18.5&&bmi<24){ + System.out.printf("bmi"+"%.3f"+"thin",bmi); +} +else if(bmi>=24&&bmi<27){ + System.out.printf("bmi"+"%.3f"+"normal",bmi); +} +else if(bmi>=27&&bmi<30){ + System.out.printf("bmi"+"%.3f"+"weight",bmi); +} +else if(bmi>=30&&bmi<35){ + System.out.printf("bmi"+"%.3f"+"overweight",bmi); +} +else{ + System.out.printf("bmi"+"%.3f"+"huge",bmi); +} + +} +} \ No newline at end of file