Day2 stept 1

This commit is contained in:
2026-09-09 13:28:03 +09:00
parent 0191dad61b
commit ec823eeab3

View File

@@ -0,0 +1,25 @@
package Day2;
import java.util.Scanner;
public class StringCheck {
public static void main(String[] args) {
String[] messages = { "いまなにしてる", "何も入力されていません", "投稿文が長すぎます", "↓↓↓↓↓↓ 投稿されました ↓↓↓↓↓↓" };
Scanner scan = new Scanner(System.in);
String str = "";
// 段階1: 無限ループ化
while (true) {
System.out.println(messages[0]);
str = scan.nextLine().trim();
System.out.println("あなたの入力は: [" + str + "]");
}
}
}