This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En07_06 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.println("季節を表示します。"); | |
System.out.print("月を入力して下さい。:"); | |
int m = stdIn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class En07_05 { | |
public static void main(String[] args) { | |
hello(); | |
} | |
// System.out.printlnで表示するメソッド | |
static void hello() { | |
System.out.println("こんにちは。"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En07_04 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.println("1からnまでの全整数を加算します。"); | |
int n; | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En07_03 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.println("3つの整数値を入力して下さい"); | |
System.out.print("整数a:"); | |
int a = stdIn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En07_02 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.println("3つの整数値を入力して下さい"); | |
System.out.print("整数a:"); | |
int a = stdIn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En07_01 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.println("入力した整数の値によって以下のように表示します。"); | |
System.out.println("負:-1 0:0 正:1"); | |
System.out.print("整数を入力:"); | |
int n = stdIn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En06_19 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
// クラス数を決定 | |
System.out.print("クラス数:"); | |
int classMax = stdIn.nextInt(); | |
int[][] classes = new int[classMax][]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class en06_18 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
int[][] c; | |
// 行数を入力させる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class En06_17 { | |
public static void main(String[] args) { | |
Random rand = new Random(); | |
// 生徒6人分の変数 | |
int student = 6; | |
// 6人のstudents多次元配列を作成 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class En06_16 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
final int max = 4; | |
final int d = 3; | |
// 4行3列の行列を作成 |