1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ずんどこプログラム

Last updated at Posted at 2020-04-04
filename.rb
package zundokoProgram;

import java.util.Random;

public class Zundoco_random {
	public static void main(String[] args) {
		Random random = new Random(); 
		String[] zun_doko = { "ずん ", "どこ " };
		String zundoko = new String();

		while (!(zundoko.equals("ずん ずん ずん ずん どこ "))) {
			zundoko = "";
			for (int i = 0; i < 5; i++) {
				String s = zun_doko[random.nextInt(2)]; // 変数sに、ランダムで選ばれた配列zun_doko要素数[0,1]  ”ずん ,”どこ ”のどちらか1文字が入る
				zundoko = zundoko.concat(s);            // 変数zundokoに変数sをくっつける
			}
			System.out.println(zundoko);
		}
		System.out.println("きよしぃいい!!!");

	}
}

ずんどこプログラム初めて記念に投稿させていただきたい・・・!!
3日くらいかかりました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?