diff --git a/AverageAge.class b/AverageAge.class deleted file mode 100644 index 57662b6..0000000 --- a/AverageAge.class +++ /dev/null Binary files differ diff --git a/AverageAge.java b/AverageAge.java deleted file mode 100644 index 1e42ae7..0000000 --- a/AverageAge.java +++ /dev/null @@ -1,44 +0,0 @@ -import java.io. *; - -public class AverageAge { - public static void main(String[] args) { - BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - try{ - //1人目のデータ - System.out.println("1人目の名前を入力してくだし"); - String line = reader.readLine(); - String name1 = line; - System.out.println(name1 + "さんの年齢は何歳ですか?"); - line = reader.readLine(); - int age1 = Integer.parseInt(line); - System.out.println(name1 + "さんの年齢は" + age1 + "歳ですね"); - - //2人目のデータ - System.out.println("2人目の名前を入力してくだし"); - line = reader.readLine(); - String name2 = line; - System.out.println(name2 + "さんの年齢は何歳ですか?"); - line = reader.readLine(); - int age2 = Integer.parseInt(line); - System.out.println(name2 + "さんの年齢は" + age2 + "歳ですね"); - double average = ((age1 + age2) / 2.0); - System.out.println("・"); - Thread.sleep(500); - System.out.println("・"); - Thread.sleep(500); - System.out.println("・"); - //2人の年齢平均を求める - System.out.println("================="); - System.out.println( name1 + "さん" + name2 + "さんの年齢平均は" + average + "です"); - System.out.println("================="); - }catch(InterruptedException e){ - e.printStackTrace(); - }catch (IOException e){ - System.out.println(e); - }catch(NumberFormatException e){ - System.out.println("正しく入力してください"); - } - } -} - - diff --git a/DistanceTraveledPerDay.class b/DistanceTraveledPerDay.class deleted file mode 100644 index 862c957..0000000 --- a/DistanceTraveledPerDay.class +++ /dev/null Binary files differ diff --git a/DistanceTraveledPerDay.java b/DistanceTraveledPerDay.java deleted file mode 100644 index 6d89c20..0000000 --- a/DistanceTraveledPerDay.java +++ /dev/null @@ -1,7 +0,0 @@ -public class DistanceTraveledPerDay { - public static void main(String[] args){ - long speed = (300000L * 60L); /* 分速*/ - int day = (24 * 60); /* 分 */ - System.out.println(speed + " × " + day + " = " + (speed * day) + "(m)" + " = " + ((speed * day) / 60 ) + "(km)") ; /* long型が優先される */ - } -} \ No newline at end of file diff --git a/Fukusyu.class b/Fukusyu.class deleted file mode 100644 index 9fd321a..0000000 --- a/Fukusyu.class +++ /dev/null Binary files differ diff --git a/HowOldAreYou.class b/HowOldAreYou.class deleted file mode 100644 index 558f29a..0000000 --- a/HowOldAreYou.class +++ /dev/null Binary files differ diff --git a/HowOldAreYou.java b/HowOldAreYou.java deleted file mode 100644 index 4099a4a..0000000 --- a/HowOldAreYou.java +++ /dev/null @@ -1,20 +0,0 @@ -import java.io. *; - -public class HowOldAreYou { - public static void main(String[] args){ - System.out.println("あなたの名前を入力:"); - BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - try{ - String line = reader.readLine(); - System.out.println(line + "さん。こんにちは。"); - System.out.println("年齢を入力してください。"); - line = reader.readLine(); - int age = Integer.parseInt(line); - System.out.println("あなたは" + age + "歳ですか。5年後は" + (age + 5) + "歳ですね。"); - }catch (IOException e) { - System.out.println(e); - }catch (NumberFormatException e){ - System.out.println("年齢が正しくありません。"); - } - } -} \ No newline at end of file diff --git a/HowTallAreYou.class b/HowTallAreYou.class deleted file mode 100644 index 35031fa..0000000 --- a/HowTallAreYou.class +++ /dev/null Binary files differ diff --git a/HowTallAreYou.java b/HowTallAreYou.java deleted file mode 100644 index 4f0c9b1..0000000 --- a/HowTallAreYou.java +++ /dev/null @@ -1,22 +0,0 @@ -import java.io. *; - -public class HowTallAreYou { - public static void main(String[] args){ - System.out.println("あなたの名前を入力してね"); - BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - try{ - String line = reader.readLine(); - System.out.println(line + "さん。こんにちは!"); - System.out.println("あなたの身長は何cmですか?(小数点まで入力してね)"); - line = reader.readLine(); - double height = Double.parseDouble(line); - System.out.println("ほー!" + height + "cmですか!"); - int roughHeight = (int)height; - System.out.println("ざっくりいうと" + (roughHeight) + "cmですね。"); - }catch (IOException e){ - System.out.println(e); - }catch (NumberFormatException e){ - System.out.println("身長が正しくありません。"); - } - } -} \ No newline at end of file diff --git a/Keisan.class b/Keisan.class deleted file mode 100644 index 1fb36f2..0000000 --- a/Keisan.class +++ /dev/null Binary files differ diff --git a/Keisan.java b/Keisan.java deleted file mode 100644 index 38a6d7e..0000000 --- a/Keisan.java +++ /dev/null @@ -1,12 +0,0 @@ -public class Keisan { - public static void main(String[] args){ - System.out.printf("0x0は %d です%n" , 0 * 0); - System.out.printf("1+1は %d です%n" , 1 * 1 ); - System.out.printf("2x2は %d です%n" , 2 * 2); - System.out.printf("3x3は %d です%n" , 3 * 3); - System.out.printf("4x4は %d です%n" , 4 * 4); - System.out.printf("5x5は %d です%n" , 5 * 5); - System.out.printf("台形の面積は %d です%n" , ((2 + 3) * 4) / 2); - System.out.printf("10000000 × 10000000 = %d %n" , 10000000L * 10000000L); - } -} \ No newline at end of file diff --git a/fukusyu.java b/fukusyu.java deleted file mode 100644 index 2899b1c..0000000 --- a/fukusyu.java +++ /dev/null @@ -1,4 +0,0 @@ -public class Fukusyu { - public static void main(String[] args){ - } -} \ No newline at end of file diff --git a/practice/AverageAge.class b/practice/AverageAge.class new file mode 100644 index 0000000..57662b6 --- /dev/null +++ b/practice/AverageAge.class Binary files differ diff --git a/practice/AverageAge.java b/practice/AverageAge.java new file mode 100644 index 0000000..1e42ae7 --- /dev/null +++ b/practice/AverageAge.java @@ -0,0 +1,44 @@ +import java.io. *; + +public class AverageAge { + public static void main(String[] args) { + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); + try{ + //1人目のデータ + System.out.println("1人目の名前を入力してくだし"); + String line = reader.readLine(); + String name1 = line; + System.out.println(name1 + "さんの年齢は何歳ですか?"); + line = reader.readLine(); + int age1 = Integer.parseInt(line); + System.out.println(name1 + "さんの年齢は" + age1 + "歳ですね"); + + //2人目のデータ + System.out.println("2人目の名前を入力してくだし"); + line = reader.readLine(); + String name2 = line; + System.out.println(name2 + "さんの年齢は何歳ですか?"); + line = reader.readLine(); + int age2 = Integer.parseInt(line); + System.out.println(name2 + "さんの年齢は" + age2 + "歳ですね"); + double average = ((age1 + age2) / 2.0); + System.out.println("・"); + Thread.sleep(500); + System.out.println("・"); + Thread.sleep(500); + System.out.println("・"); + //2人の年齢平均を求める + System.out.println("================="); + System.out.println( name1 + "さん" + name2 + "さんの年齢平均は" + average + "です"); + System.out.println("================="); + }catch(InterruptedException e){ + e.printStackTrace(); + }catch (IOException e){ + System.out.println(e); + }catch(NumberFormatException e){ + System.out.println("正しく入力してください"); + } + } +} + + diff --git a/practice/DistanceTraveledPerDay.class b/practice/DistanceTraveledPerDay.class new file mode 100644 index 0000000..862c957 --- /dev/null +++ b/practice/DistanceTraveledPerDay.class Binary files differ diff --git a/practice/DistanceTraveledPerDay.java b/practice/DistanceTraveledPerDay.java new file mode 100644 index 0000000..6d89c20 --- /dev/null +++ b/practice/DistanceTraveledPerDay.java @@ -0,0 +1,7 @@ +public class DistanceTraveledPerDay { + public static void main(String[] args){ + long speed = (300000L * 60L); /* 分速*/ + int day = (24 * 60); /* 分 */ + System.out.println(speed + " × " + day + " = " + (speed * day) + "(m)" + " = " + ((speed * day) / 60 ) + "(km)") ; /* long型が優先される */ + } +} \ No newline at end of file diff --git a/practice/Fukusyu.class b/practice/Fukusyu.class new file mode 100644 index 0000000..9fd321a --- /dev/null +++ b/practice/Fukusyu.class Binary files differ diff --git a/practice/HowOldAreYou.class b/practice/HowOldAreYou.class new file mode 100644 index 0000000..558f29a --- /dev/null +++ b/practice/HowOldAreYou.class Binary files differ diff --git a/practice/HowOldAreYou.java b/practice/HowOldAreYou.java new file mode 100644 index 0000000..4099a4a --- /dev/null +++ b/practice/HowOldAreYou.java @@ -0,0 +1,20 @@ +import java.io. *; + +public class HowOldAreYou { + public static void main(String[] args){ + System.out.println("あなたの名前を入力:"); + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); + try{ + String line = reader.readLine(); + System.out.println(line + "さん。こんにちは。"); + System.out.println("年齢を入力してください。"); + line = reader.readLine(); + int age = Integer.parseInt(line); + System.out.println("あなたは" + age + "歳ですか。5年後は" + (age + 5) + "歳ですね。"); + }catch (IOException e) { + System.out.println(e); + }catch (NumberFormatException e){ + System.out.println("年齢が正しくありません。"); + } + } +} \ No newline at end of file diff --git a/practice/HowTallAreYou.class b/practice/HowTallAreYou.class new file mode 100644 index 0000000..35031fa --- /dev/null +++ b/practice/HowTallAreYou.class Binary files differ diff --git a/practice/HowTallAreYou.java b/practice/HowTallAreYou.java new file mode 100644 index 0000000..4f0c9b1 --- /dev/null +++ b/practice/HowTallAreYou.java @@ -0,0 +1,22 @@ +import java.io. *; + +public class HowTallAreYou { + public static void main(String[] args){ + System.out.println("あなたの名前を入力してね"); + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); + try{ + String line = reader.readLine(); + System.out.println(line + "さん。こんにちは!"); + System.out.println("あなたの身長は何cmですか?(小数点まで入力してね)"); + line = reader.readLine(); + double height = Double.parseDouble(line); + System.out.println("ほー!" + height + "cmですか!"); + int roughHeight = (int)height; + System.out.println("ざっくりいうと" + (roughHeight) + "cmですね。"); + }catch (IOException e){ + System.out.println(e); + }catch (NumberFormatException e){ + System.out.println("身長が正しくありません。"); + } + } +} \ No newline at end of file diff --git a/practice/Keisan.class b/practice/Keisan.class new file mode 100644 index 0000000..1fb36f2 --- /dev/null +++ b/practice/Keisan.class Binary files differ diff --git a/practice/Keisan.java b/practice/Keisan.java new file mode 100644 index 0000000..38a6d7e --- /dev/null +++ b/practice/Keisan.java @@ -0,0 +1,12 @@ +public class Keisan { + public static void main(String[] args){ + System.out.printf("0x0は %d です%n" , 0 * 0); + System.out.printf("1+1は %d です%n" , 1 * 1 ); + System.out.printf("2x2は %d です%n" , 2 * 2); + System.out.printf("3x3は %d です%n" , 3 * 3); + System.out.printf("4x4は %d です%n" , 4 * 4); + System.out.printf("5x5は %d です%n" , 5 * 5); + System.out.printf("台形の面積は %d です%n" , ((2 + 3) * 4) / 2); + System.out.printf("10000000 × 10000000 = %d %n" , 10000000L * 10000000L); + } +} \ No newline at end of file diff --git a/practice/fukusyu.java b/practice/fukusyu.java new file mode 100644 index 0000000..2899b1c --- /dev/null +++ b/practice/fukusyu.java @@ -0,0 +1,4 @@ +public class Fukusyu { + public static void main(String[] args){ + } +} \ No newline at end of file