herrDeng網內搜尋

自訂搜尋

Ads

2016年9月23日 星期五

ex3 java輸入輸出練習

請輸入姓名xyz、身高m(cm)、體重w(kg),

輸出為"xyz的BMI值=****"

註:BMI=w*10000/(m*m)


24 則留言:

A10533005 提到...

import java.util.Scanner;

public class ex2b {

public static void main(String[] args) {
Scanner aaa = new Scanner(System.in);
System.out.print("請輸入名字:");
String x;
x = aaa.nextLine();
System.out.println("請輸入身高:");
double h;
h = aaa.nextDouble();
System.out.println("請輸入體重:");
double w;
w = aaa.nextDouble();
System.out.println(x+"的BMI為"+w*10000/(h*h));






}

}

A10533003 提到...

package d;
import java.util.*;

public class HL {

public static void main(String[] args){
Scanner X=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=X.nextLine();
System.out.println("大名是"+z);

}

A10533012 提到...

import java.util.Scanner;

public class sa {

public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String y=x.nextLine();
System.out.println(y);


}

}

A10533007 提到...

import java.util.*;

public class aa {

public static void main(String[] args){
Scanner X=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=X.nextLine();
System.out.println("大名是"+z);


}

}

A10533011 提到...

import java.util.Scanner;
public class ex1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String n;
double h;
double w;
System.out.println("請輸入姓名");
n=scan.nextLine();
System.out.println("請輸入身高");
h=scan.nextDouble();
System.out.println("請輸入體重");
w=scan.nextDouble();
System.out.println(n+"的BMI值="+w*10000/(h*h));
}
}

A105333002 提到...

import java.util.*;

public class ex20 {

public static void main(String[] args) {
Scanner aaa=new Scanner(System.in);
System.out.println("請輸入姓名:");
String X;
X= aaa.nextLine();
System.out.println("請輸入身高:");
double Y;
Y= aaa.nextDouble();
System.out.println("請輸入體重:");
double E;
E= aaa.nextDouble();
System.out.println(X+"的BMI為"+E*10000/(Y*Y));

A10533016 提到...

import java.util.*;

public class ex1 {

public static void main(String[] args) {
Scanner aaa=new Scanner(System.in);
System.out.println("請輸入姓名");
String X;
X=aaa.nextLine();
System.out.println("請輸入身高");
double Y;
Y=aaa.nextDouble();
System.out.println("請輸入體重");
double E;
E=aaa.nextDouble();
System.out.println(X+"的BMI為"+E*10000/(Y*Y));

A10533012 提到...

import java.util.Scanner;

public class sa {

public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String y=x.nextLine();
System.out.println(y);


}

}

a10533001范采臻 提到...

import java.util.Scanner;

public class ggg {

public static void main(String[] args) {
Scanner a=new Scanner(System.in);
System.out.println("name");
String s=a.nextLine();
System.out.println("height");
double d=a.nextDouble();
System.out.println("weight");
double f=a.nextDouble();
System.out.println(s+"的BMI"+f*10000/(d*d));

}
}

A105333002 提到...

import java.util.*;

public class ex20 {

public static void main(String[] args) {
Scanner aaa=new Scanner(System.in);
System.out.println("請輸入姓名:");
String X;
X= aaa.nextLine();
System.out.println("請輸入身高:");
double Y;
Y= aaa.nextDouble();
System.out.println("請輸入體重:");
double E;
E= aaa.nextDouble();
System.out.println(X+"的BMI為"+E*10000/(Y*Y));

A10533012 提到...

import java.util.Scanner;

public class sa {

public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String y=x.nextLine();
System.out.println(y);


}

}

A10533009林子喬 提到...

import java.util.*;

public class Hello {

public static void main(String[] args) {
float m,w,bmi0;
Scanner x=new Scanner(System.in);
m=x.nextFloat();
System.out.println("身高"+m);
w=x.nextFloat();
System.out.println("kg"+w);
bmi0=w*10000/(m*m);
System.out.println("bmi="+bmi0);

}

}

A10533014 提到...

------------------------------------------------------------
import java.util.*;

public class one {

public static void main(String[] args) {

Scanner X=new Scanner(System.in);
System.out.println("輸入姓名>>");
String z=X.nextLine();
System.out.println("大名是:"+z);


}
------------------------------------------------------------
}

import java.util.*;
public class bmmmmm {

public static void main(String[] args) {

float m,w,bmi0;
Scanner x=new Scanner(System.in);
m=x.nextFloat();
System.out.println("Height"+m);
w=x.nextFloat();
System.out.println("Weight"+w);
bmi0=w*1000/(m*m);
System.out.println("bmi="+bmi0);
}

}
------------------------------------------------------------

A10533009林子喬 提到...

import java.util.Scanner;

public class HA {

public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=x.nextLine();
System.out.println("大名是"+z);
}

}

A10533004易廷軒 提到...

import java.util.*;

public class ex2 {

public static void main(String[] args) {
float m,w,bmi0;
Scanner x=new Scanner(System.in);
m=x.nextFloat();
System.out.println("身高"+m);
w=x.nextFloat();
System.out.println("公斤"+w);
bmi0=w*10000/(m*m);
System.out.println("bmi="+bmi0);

}

}

A10533004易廷軒 提到...

import java.util.*;

public class ex1 {

public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=x.nextLine();
System.out.println("大名是"+z);

}

}

A10533006林柏宇 提到...

import java.util.Scanner;

public class ex1 {
public static void main(String[] args) {
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=x.nextLine();
System.out.println("大名是"+z);
}

}

A10533006林柏宇 提到...

import java.util.*;

public class ex2b {
public static void main(String[] args) {
float m,w,bmi0;
Scanner x=new Scanner(System.in);
m=x.nextFloat();
System.out.println("身高"+m);
w=x.nextFloat();
System.out.println("kg"+w);
bmi0=w*10000/(m*m);
System.out.println("bmi="+bmi0);

}
}

A10533003 提到...

package d;

import java.util.*;

public class BMI {

public static void main(String[]args){
float m,w,bmi0;
Scanner x=new Scanner(System.in);
m=x.nextFloat();
System.out.println("身高"+m);
w=x.nextFloat();
System.out.println("kg"+w);
bmi0=w*10000/(m*m);
System.out.println("bmi="+bmi0);


}
}

A10533013 提到...

import java.util.Scanner;

public class ex2
{
public static void main(String[] args) {
double m,w,bmi; //m=身高 w=體重
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String z=x.nextLine();
//System.out.println("大名是"+z);

System.out.println("請輸入身高");
m=x.nextDouble();
//System.out.println("身高"+m);

System.out.println("請輸入體重");
w=x.nextDouble();
//System.out.println("體重"+w);
bmi=w*10000/(m*m);
System.out.println(z+"的bmi="+bmi);


}
}

A10533010 提到...

mport java.util.Scanner;

public class ex2
{
public static void main(String[] args) {
double m,w,bmi; //m=身高 w=體重
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String z=x.nextLine();
//System.out.println("大名是"+z);

System.out.println("請輸入身高");
m=x.nextDouble();
//System.out.println("身高"+m);

System.out.println("請輸入體重");
w=x.nextDouble();
//System.out.println("體重"+w);
bmi=w*10000/(m*m);
System.out.println(z+"的bmi="+bmi);


}
}

A10533012 提到...

mport java.util.Scanner;

public class ex2
{
public static void main(String[] args) {
double m,w,bmi; //m=身高 w=體重
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String z=x.nextLine();
//System.out.println("大名是"+z);

System.out.println("請輸入身高");
m=x.nextDouble();
//System.out.println("身高"+m);

System.out.println("請輸入體重");
w=x.nextDouble();
//System.out.println("體重"+w);
bmi=w*10000/(m*m);
System.out.println(z+"的bmi="+bmi);


}
}

A10533012 提到...

mport java.util.Scanner;

public class ex2
{
public static void main(String[] args) {
double m,w,bmi; //m=身高 w=體重
Scanner x=new Scanner(System.in);
System.out.println("請輸入姓名");
String z=x.nextLine();
//System.out.println("大名是"+z);

System.out.println("請輸入身高");
m=x.nextDouble();
//System.out.println("身高"+m);

System.out.println("請輸入體重");
w=x.nextDouble();
//System.out.println("體重"+w);
bmi=w*10000/(m*m);
System.out.println(z+"的bmi="+bmi);


}
}

A10533007 提到...

import java.util.*;

public class aa {

public static void main(String[] args){
float m,w,bmi0;
Scanner X=new Scanner(System.in);
System.out.println("請輸入姓名>");
String z=X.nextLine();
//System.out.println("大名是"+z);

System.out.println("請輸入身高>");
m=X.nextFloat();
//System.out.println("身高"+m);
System.out.println("請輸入kg");
w=X.nextFloat();
// System.out.println("kg"+w);
bmi0=w*10000/(m*m);
System.out.println(z+"bmi="+bmi0);



}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章