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
| The MIT License (MIT) | |
| Copyright (c) 2015 Ritsuki Goto | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| this software and associated documentation files (the "Software"), to deal in | |
| the Software without restriction, including without limitation the rights to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, | |
| subject to the following conditions: |
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
| import java.util.Random; | |
| public class Array_Haiku { | |
| public static void main(String[] args) throws Exception { | |
| int num = 6;//俳句の数 | |
| int ran = new Random().nextInt(num);//変数ranにnumの数の乱数を振る | |
| String[] data = new String[num];//配列の定義 | |
| data[0] = "プログラマ/いのちけずって/今日も行く";//配列の中に、内容を入力。"/"で分ける |
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
| import java.util.Random; | |
| public class Short_Haiku { | |
| public static void main(String[] args) throws Exception { | |
| String data = "プロ生ちゃん / プログラマーの/ 癒しの子 "; | |
| String[] strAry = data.split("/"); | |
| for (int i = 0; i < 7; i++){ | |
| System.out.print(strAry[2].substring(i,i+1)); | |
| System.out.print(strAry[1].substring(i,i+1)); |
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
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| import java.util.Random; | |
| import java.io.File; | |
| import java.io.FileReader; | |
| import java.io.FileNotFoundException; | |
| import java.io.IOException; | |
| public class DataRead_Haiku { | |
| static int n = 0; |
NewerOlder