import java.util.Scanner;

class JAVA4154{

public static void main(String args) {
Scanner stdIn = new Scanner(System.in);

System.out.println("整数値xとyとzの合計と平均を求めます。");
System.out.print("xの値:"); int x = stdIn.nextInt();
System.out.print("yの値:"); int y = stdIn.nextInt();
System.out.print("zの値:"); int z = stdIn.nextInt();

double total = x + y + z;
double ave = ( x + y + z ) / 3.0;
System.out.println("xとyとzの合計値は" + total + "です。");
System.out.println("xとyとzの平均値は" + ave + "です。");
}
}

 

 

import java.util.Scanner;

class JAVA4155{

public static void main(String args) {
Scanner stdIn = new Scanner(System.in);

System.out.println("整数値xとyとzの合計と平均を求めます。");
System.out.print("xの値:"); int x = stdIn.nextInt();
System.out.print("yの値:"); int y = stdIn.nextInt();
System.out.print("zの値:"); int z = stdIn.nextInt();

double total = x + y + z;
double ave = (double)( x + y + z ) / 3;
System.out.println("xとyとzの合計値は" + total + "です。");
System.out.println("xとyとzの平均値は" + ave + "です。");
}
}

 

class JAVA4156{

public static void main(String args) {

System.out.println(" float int");
System.out.println("--------------------");
int i = 0;
for (float x = 0.0F; x <= 1.0F; x += 0.001F) {
System.out.print(String.format("%.7f",x));
System.out.println(" " + String.format("%.7f",(double)i/1000));
i++;
}

}

}

 

 

class JAVA4157{

public static void main(String args) {


for (int x = 0; x <= 1000; x ++) {
System.out.println(String.format("%.3f",(double)x/1000)
+ " " + String.format("%.6f",(double)x*x/1000000));

}

}
}

 

 

import java.util.Scanner;

class Q42{

public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.print("整数(最大8桁)を入力してください:");
int n = stdIn.nextInt();
int o = 0;int p = 0;int q = 0;int r = 0;int s = 0;

if (n/100000000 >= 1){
System.out.print("9桁以上の整数が入力されました。");}

else{
for(int i = 8; i >= 1; i--){
int a = ( n % (int)Math.pow(10,i) / (int)Math.pow(10,i-1) );
if (a > 0) o = 1;
if (a == 1){System.out.print(" * ");} else if (a == 4){
System.out.print("* * ");} else if ( a > 0){
System.out.print("**** ");}
if (a == 0 && o == 1) {System.out.print("**** ");}
}System.out.println();

for(int j = 8; j >= 1; j--){
int a = ( n % (int)Math.pow(10,j) / (int)Math.pow(10,j-1) );
if (a > 0) p = 1;
if (a <= 3 && a > 0){System.out.print(" * ");} else if ( a == 5 || a == 6 ){
System.out.print("* ");} else if (a > 0){
System.out.print("* * ");}
if (a == 0 && p == 1) {System.out.print("* * ");}
}System.out.println();

for(int k = 8; k >= 1; k--){
int a = ( n % (int)Math.pow(10,k) / (int)Math.pow(10,k-1) );
if (a > 0) q = 1;
if (a == 1 || a == 7){System.out.print(" * ");} else if ( a > 0 ){
System.out.print("**** ");}
if (a == 0 && q == 1) {System.out.print("* * ");}
}System.out.println();

for(int l = 8; l >= 1; l--){
int a = ( n % (int)Math.pow(10,l) / (int)Math.pow(10,l-1) );
if (a > 0) r = 1;
if (a == 2){System.out.print("* ");} else if ( a == 6 || a == 8){
System.out.print("* * ");} else if (a > 0) {
System.out.print(" * ");}
if (a == 0 && r == 1) {System.out.print("* * ");}
}System.out.println();

for(int m = 8; m >= 1; m--){
int a = ( n % (int)Math.pow(10,m) / (int)Math.pow(10,m-1) );
if (a > 0) s = 1;
if (a == 1 || a == 4 || a == 7){System.out.print(" * ");} else if (a > 0){
System.out.print("**** ");}
if (a == 0 && s == 1) {System.out.print("**** ");}
}System.out.println();
}
}
}