This file contains hidden or 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 FizzBuzz{ | |
public static void main(String[] args){ | |
for ( int i = 1; i < 101; i++){ | |
if ( i % 15 == 0 ){ | |
System.out.println("FizzBuzz"); | |
} else if ( i % 5 == 0 ){ | |
System.out.println("Buzz"); | |
} else if ( i % 3 == 0 ){ | |
System.out.println("Fizz"); | |
} else { |
This file contains hidden or 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 Triangle{ | |
public static void main(String[] args){ | |
int i = 0; | |
int j = 0; | |
for (i = 0; i < 11; i++){ | |
for (j = 0; j < i; j++){ | |
System.out.print("*"); | |
} | |
System.out.println(""); | |
} |
This file contains hidden or 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 Hosyu{ | |
public static void main(String[] args){ | |
for (int i = 10; i > 0 ;i--){ | |
strVar(i); | |
} | |
} | |
public static void strVar(int n){ | |
for (int m = 0; m < n; m++){ | |
System.out.print("*"); |
This file contains hidden or 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 Heikin6{ | |
public static void main(String[] args){ | |
//int ten; | |
//ten = new int[][]; | |
int ten[][] = { | |
{212,43,56,231,125}, | |
{124,46,78,12,5}, | |
{12,45,67,90,12}, | |
{45,90,12}, | |
}; |
This file contains hidden or 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
/** | |
* | |
* @author nuki ここではヒットアンドブローのための ランダムな被りのない4桁の数字を生成するクラス作成する。 | |
* | |
*/ | |
public class CreateRandomNumber { | |
// 乱数の桁数を定数として生成 | |
public static final int FINAL_NUMBER = 4; | |
public static void RandomNumber() { |
This file contains hidden or 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
package data.create; | |
/** | |
* | |
* @author nuki ここではヒットアンドブローのための ランダムな被りのない4桁の数字を生成するクラス作成する。 | |
* | |
*/ | |
public class CreateRandomNumber { | |
// 乱数の桁数を定数として生成 | |
public static final int FINAL_NUMBER = 4; |
This file contains hidden or 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
package data.create; | |
/** | |
* | |
* @author nuki ここではヒットアンドブローのための ランダムな被りのない4桁の数字を生成するクラス作成する。 | |
* | |
*/ | |
public class CreateRandomNumber { | |
/* | |
* 乱数の桁数を定数として宣言 |
This file contains hidden or 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
package jp.ac.ca.data.create; | |
/** | |
* | |
* @author nuki ここではヒットアンドブローのための ランダムな被りのない4桁の数字を生成するクラス作成する。 | |
* | |
*/ | |
public class CreateRandomNumber { | |
/* | |
* 乱数の桁数を定数として宣言 |
This file contains hidden or 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
package jp.ac.ca.common; | |
//import java.util.Random; | |
//import jp.ac.ca.data.create.CreateRandomNumber; | |
import jp.ac.ca.data.input.UserInputNumber; | |
/** | |
* | |
* @author nuki このクラスはメインクラスとなる 他のpackageに作成したクラスを呼び出し処理を実行していく |
This file contains hidden or 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
package jp.ac.ca.data.input; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.io.IOException; | |
import jp.ac.ca.data.create.CreateRandomNumber; | |
//import java.text.NumberFormat; |
OlderNewer