double m=1.65,w=67,BMI; BMI=w/(m*m); System.out.println("BMI="+BMI); if (BMI<18.5) System.out.println("體重過輕"); else if (BMI<24) System.out.println("正常體重"); else if (BMI<27)
public class test{ public static void main(String[]atgs){ int m=165; int w=53; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else{ System.out.print("過重"); } } }
public class apple{ public static void main(String[] args){ int m=172; int w=88; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else if(bmi<27){ System.out.print("過重"); } else System.out.print("肥胖"); } }
public class test{ public static void main(String[]atgs){ int m=165; int w=53; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else if (bmi<27){ System.out.print("過重"); } else{ System.out.print("肥胖"); } } }
public class apple { public static void main(String[]atgs){ int m=167; int w=57; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else if (bmi<27){ System.out.print("過重"); } else{ System.out.print("肥胖"); } }
public class apple{ public static void main(String[]args){ int m=180; int w=95; Float bmi=(float)w/(m*m)*10000; if (bmi<18.5){ System.out.print("過輕"); } else if (bmi<24) { System.out.print("一般"); } else if (bmi<27) { System.out.print("過重"); } else{ System.out.print("肥胖"); } }
public class BMI { public static void main(String[]atgs){ int m=161; int w=51; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else if (bmi<27){ System.out.print("過重"); } else{ System.out.print("肥胖"); } }
public class sam{ public static void main(String[] args){ int m=170; int w=60; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else if(bmi<27){ System.out.print("過重"); } else System.out.print("肥胖"); } }
public class test{ public static void main(String[]atgs){ int m=165; int w=53; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else{ System.out.print("過重"); } } }
public class test{ public static void main(String[]atgs){ int m=165; int w=53; float bmi=(float)w/(m*m)*10000; if(bmi<18.5){ System.out.print("過輕"); } else if (bmi<24){ System.out.print("一般"); } else{ System.out.print("過重"); } } }
69 則留言:
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m = 1.77 , w = 87 ;
float bmi ;
bmi = (float) (w/(m*m)) ;
System.out.println(bmi);
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi < 27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class b9933122_01 {
public static void main(String[] args) {
// TODO Auto-generated method stub
float h=163,w=60;
float bmi=w/(h*h)*10000;
if(bmi<18.5){
System.out.println("過輕");
}else if(bmi<24){
System.out.println("正常");
}else if(bmi<27){
System.out.println("過重");
} else{
System.out.println("肥胖");
}
}
}
public class Test_one {
public static void main(String[] args) {
float h = 178, w = 62;
float bmi = w / (h * h) * 10000;
if (bmi < 18.5) {
System.out.println("過輕!");
} else if (bmi < 24) {
System.out.println("正常!");
} else if (bmi < 27) {
System.out.println("過重!");
} else {
System.out.println("肥胖!");
}
}
}
public class fir{
public static void main(String[] args){
float m=162;
float w=51;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else
System.out.print("過輕");
}
}
public class aa {
public static void main(String[] args){
float m=170;
float w=60;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class sor{
public static void main(String[] args){
float m=178;
float w=62;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else
System.out.print("過輕");
}
}
public class java {
public static void main(String[] args) {
float h=165 , w=50 ;
float bmi=w/(h*h)*10000;
if (bmi<18.5){
System.out.println("過輕");
}
else if (bmi<24){
System.out.println("正常體重");
}
else if (bmi<27){
System.out.println("過重");
}
else {
System.out.println("肥胖");
}
}
}
public class aa {
public static void main(String[] args){
float m=168;
float w=54;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class ifelseBMI {
static public void main (String[] args){
double m=1.65,w=67,BMI;
BMI=w/(m*m);
System.out.println("BMI="+BMI);
if (BMI<18.5)
System.out.println("體重過輕");
else if (BMI<24)
System.out.println("正常體重");
else if (BMI<27)
public class aa {
public static void main(String[] args){
float m=200;
float w=55;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class aa {
public static void main(String[] args){
float m=177;
float w=58;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class ga{
public static void main(String[] args)
{
float m=177;
float w=73;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else
System.out.print("過輕");
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi >= 18.5 && bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if (bmi >= 24 && bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
public class yy{
public static void main(String[] args)
{
float m=164;
float w=76;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else
System.out.print("過輕");
}
}
class bmi{
public static void main (String [] args){
float m=158;
float w=50;
float bmi=(float)w/(m*m)*10000;
System.out.println(bmi);
if (bmi<18.5){
System.out.println("過輕");
}
else if (bmi<24){
System.out.println("正常體重");
}
else if (bmi<27){
System.out.println("過重");
}
else {
System.out.println("肥胖");
}
}
}
class test
{
public static void main(String[] args)
{
float m =170;
float w =63;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi>=18.5&&bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi>=24&&bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
class LANG { public static void main (String [] args){
Scanner input=new Scanner(System.in);
float m=162;
float w=77;
float bmi=(float)w/(m*m)*10000;
System.out.println(bmi);
if (bmi < 18.5 )
{System.out.println("過輕");
}
else if ( bmi < 24 ){
System.out.println("正常體重");
}
else if ( bmi < 27 ){
System.out.println("過重");
}
else
System.out.println("肥胖");
}
}
class test
{
public static void main(String[] args)
{
float m =168;
float w =57;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi>=18.5&&bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi>=24&&bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi >= 18.5 && bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if (bmi >= 24 && bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
import java.util.*;
class BBBB { public static void main (String [] args){
Scanner input=new Scanner(System.in);
float m=160;
float w=52;
float bmi=(float)w/(m*m)*10000;
System.out.println(bmi);
if (bmi < 18.5 )
{System.out.println("過輕");
}
else if ( bmi < 24 )
{System.out.println("正常體重");
}
else if ( bmi < 27 )
{System.out.println("過重");
}
else
{System.out.println("肥胖");
}
public class test{
public static void main(String[]atgs){
int m=165;
int w=53;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else{
System.out.print("過重");
}
}
}
class test
{
public static void main(String[] args)
{
float m =170;
float w =63;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi>=18.5&&bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi>=24&&bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
public class apple{
public static void main(String[] args){
int m=172;
int w=88;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else if(bmi<27){
System.out.print("過重");
}
else
System.out.print("肥胖");
}
}
class bb
{
public static void main(String[] args)
{
float m =160;
float w =52;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi>=18.5&&bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi>=24&&bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
class bmi {
public static void main (String [] args){
Scanner input=new Scanner(System.in);
float m=160;
float w=50;
float bmi=(float)w/(m*m)*10000;
System.out.println(bmi);
if (bmi < 18.5 ) {
System.out.println("過輕"); }
else if ( bmi <24){
System.out.println("正常體重"); }
else if ( bmi <27){
System.out.println("過重"); }
else {
System.out.println("肥胖"); }
}
}
public class test{
public static void main(String[]atgs){
int m=165;
int w=53;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else if (bmi<27){
System.out.print("過重");
}
else{
System.out.print("肥胖");
}
}
}
public class apple {
public static void main(String[]atgs){
int m=167;
int w=57;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else if (bmi<27){
System.out.print("過重");
}
else{
System.out.print("肥胖");
}
}
}
public class apple{
public static void main(String[]args){
int m=180;
int w=95;
Float bmi=(float)w/(m*m)*10000;
if (bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24) {
System.out.print("一般");
}
else if (bmi<27) {
System.out.print("過重");
}
else{
System.out.print("肥胖");
}
}
}
class test
{
public static void main(String[] args)
{
float m =168;
float w =57;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*; class bmi { public static void main (String [] args){ Scanner input=new Scanner(System.in); float m=145; float w=38; float bmi=(float)w/(m*m)*10000; System.out.println(bmi); if (bmi < 18.5 ) {System.out.println("過輕"); } else if ( bmi < 24 ){ System.out.println("正常體重"); } else if ( bmi < 27 ){ System.out.println("過重"); } else System.out.println("肥胖"); } }
import java.util.*;
class bmi {
public static void main (String [] args){
Scanner input=new Scanner(System.in);
float m=165;
float w=55;
float bmi=(float)w/(m*m)*10000;
System.out.println(bmi);
if (bmi < 18.5 ) {
System.out.println("過輕"); }
else if ( bmi <24){
System.out.println("正常體重"); }
else if ( bmi <27){
System.out.println("過重"); }
else {
System.out.println("肥胖"); }
}
}
class test
{
public static void main(String[] args)
{
float m =170;
float w =63;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if ( bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
class test
{
public static void main(String[] args)
{
float m =166;
float w =66;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if ( bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
import java.util.*;
public class ss
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if ( bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
Scanner inputScanner = new Scanner(System.in);
float m = inputScanner.nextFloat(); // 輸入身高
float w = inputScanner.nextFloat(); // 輸入體重
float bmi = w / (m * m) * 10000;
if (bmi < 18.5)
{
System.out.println("過輕");
}
else if ((bmi >= 18.5) && (bmi < 24))
{
System.out.println("正常");
}
else if ((bmi >= 24) && (bmi < 27))
{
System.out.println("過重");
}
else
{
System.out.println("肥胖");
}
class aa
{
public static void main(String[] args)
{
float m =160;
float w =60;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class bb
{
public static void main(String[] args)
{
float m =160;
float w =52;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if ( bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
import java.util.*;public class 123 {public static void main(String[] args) {Scanner input=new Scanner(System.in);int m=input.nextInt();int w=input.nextInt();float bmi=(float)w/(m*m)*10000;System.out.println(bmi);if ( bmi<18.4 ){ System.out.println("過輕");}else if (bmi <24 ){ System.out.println("標準");}else if (bmi >24 ){ System.out.println("過重");}else { System.out.println("肥胖");}}}.
class bb
{
public static void main(String[] args)
{
float m =150;
float w =50;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class bb
{
public static void main(String[] args)
{
float m =150;
float w =40;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class BMI{
public static void main(String[] args)
{
int w=161;
int m=51;
float bmi=(float) w/(m*m);
if ( bmi < 18.5 )
{
System.out.println("體重過輕");
}
else if ( bmi < 24 )
{
System.out.println("體重正常");
}
else
{
System.out.println("體重過重");
}
}
}
class BMI
{
public static void main(String[] arge)
{
float m =168;
float w =68;
float bmi = w/(m*m)*10000;
if (bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class BMI
{
public static void main(String[] arge)
{
float m =168;
float w =68;
float bmi = w/(m*m)*10000;
if (bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class BMI
{
public static void main(String[] arge)
{
float m =165;
float w =55;
float bmi = w/(m*m)*10000;
if (bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class BMI
{
public static void main(String[] arge)
{
float m =179;
float w =63;
float bmi = w/(m*m)*10000;
if (bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
public class BMI {
public static void main(String[]atgs){
int m=161;
int w=51;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else if (bmi<27){
System.out.print("過重");
}
else{
System.out.print("肥胖");
}
}
}
public class MtcTW
{
public static void main(String[] args)
{
int m=177;
int w=54;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("過輕");
}
else if (bmi<24)
{
System.out.print("一般");
}
else if(bmi<27)
{
System.out.print("過重");
}
else
System.out.print("肥胖");
}
}
public class sam{
public static void main(String[] args){
int m=170;
int w=60;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else if(bmi<27){
System.out.print("過重");
}
else
System.out.print("肥胖");
}
}
public class fir{
public static void main(String[] args){
float m=162;
float w=51;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else
System.out.print("過輕");
}
}
import java.util.*;
public class aa
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("請輸入身高");
int x =input.nextInt();
System.out.println(x);
System.out.println("請輸入體重");
int y =input.nextInt();
System.out.println(y);
float bmi=(float) y/(x*x)*10000;
System.out.print("你的BMI值為:");
System.out.print(bmi);
if (bmi < 18.5)
System.out.println("\nBMI = " + bmi + " 過輕。\n");
else if (bmi >= 18.5 && bmi < 24)
System.out.println("\nBMI = " + bmi + " 正常體重。\n");
else if (bmi >= 24 && bmi < 27)
System.out.println("\nBMI = " + bmi + " 過重。\n");
else
System.out.println("\nBMI = " + bmi + " 肥胖。\n");
}
}
public class test{
public static void main(String[]atgs){
int m=165;
int w=53;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else{
System.out.print("過重");
}
}
}
public class test{
public static void main(String[]atgs){
int m=165;
int w=53;
float bmi=(float)w/(m*m)*10000;
if(bmi<18.5){
System.out.print("過輕");
}
else if (bmi<24){
System.out.print("一般");
}
else{
System.out.print("過重");
}
}
}
public class aa {
public static void main(String[] args){
float m=168;
float w=54;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m=1.62, w=75 ;
float bmi ;
bmi =(float) (w/(m*m));
System.out.println(bmi) ;
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi <27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m=1.62, w=75 ;
float bmi ;
bmi =(float) (w/(m*m));
System.out.println(bmi) ;
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi <27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class NYPD {
public static void main(String[] args) {
// TODO Auto-generated method stub
float h=177,w=100;
float bmi=w/(h*h)*10000;
if(bmi<18.5){
System.out.println("過輕~");
}else if(bmi<24){
System.out.println("正常~");
}else if(bmi<27){
System.out.println("過重~");
} else{
System.out.println("肥胖~");
}
}
}
public class aa {
public static void main(String[] args){
float m=170;
float w=60;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常體重");
}
else {
System.out.print("過輕");
}
}
}
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m=1.62, w=75 ;
float bmi ;
bmi =(float) (w/(m*m));
System.out.println(bmi) ;
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi <27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class ifelseBMI {
static public void main (String[] args){
double m=1.65,w=55,BMI;
BMI=w/(m*m);
System.out.println("BMI="+BMI);
if (BMI<18.5)
System.out.println("過輕");
else if (BMI<24)
System.out.println("正常");
else if (BMI<27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class ifelseBMI {
static public void main (String[] args){
double m=1.65,w=55,BMI;
BMI=w/(m*m);
System.out.println("BMI="+BMI);
if (BMI<18.5)
System.out.println("過輕");
else if (BMI<24)
System.out.println("正常");
else if (BMI<27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class SAN{
public static void main(String[] args){
float m=164;
float w=52;
float bmi=w/(m*m)*10000;
if(bmi>=27){
System.out.print("肥胖");
}
else if(bmi>=24){
System.out.print("過重");
}
else if(bmi>=18.5){
System.out.print("正常");
}
else
System.out.print("過輕");
}
}
class aa
{
public static void main(String[] args)
{
float m =160;
float w =60;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class bb
{
public static void main(String[] args)
{
float m =160;
float w =52;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
class aa
{
public static void main(String[] args)
{
float m =160;
float w =60;
float bmi = w/(m*m)*10000;
if(bmi<18.5)
{
System.out.print("bmi="+bmi+"為過輕");
}
else if(bmi<=24)
{
System.out.print("bmi="+bmi+"為正常");
}
else if(bmi<27)
{
System.out.print("bmi="+bmi+"為過重");
}
else if(bmi>=27)
{
System.out.print("bmi="+bmi+"為肥胖");
}
}
}
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m = 1.77 , w = 87 ;
float bmi ;
bmi = (float) (w/(m*m)) ;
System.out.println(bmi);
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi < 27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
public class bmi {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double m = 1.77 , w = 87 ;
float bmi ;
bmi = (float) (w/(m*m)) ;
System.out.println(bmi);
if (bmi < 18.5)
System.out.println("過輕");
else if (bmi <24)
System.out.println("正常");
else if (bmi < 27)
System.out.println("過重");
else
System.out.println("肥胖");
}
}
張貼留言