3日目 段階2 小澤

This commit is contained in:
2026-09-10 15:05:51 +09:00
parent 152c897520
commit d804a93cd4

View File

@@ -24,16 +24,16 @@ public class StringCheck {
str = imputString();
boolean isEmpty = (str.length() == 0);
boolean isTooLong = (str.length() > 140);
// boolean isEmpty = (str.length() == 0);
// boolean isTooLong = (str.length() > 140);
if (isEmpty) {
if (isEmptyInput(str)) {
System.out.println(messages[1]);
continue;
}
if (isTooLong) {
if (isTooLongInput(str)) {
System.out.println(messages[2]);
continue;
}
@@ -51,5 +51,15 @@ public class StringCheck {
String line = scanner.nextLine();
return line.strip();
}
public static boolean isEmptyInput(String text) {
return text.length() == 0;
}
public static boolean isTooLongInput(String text) {
return text.length() > 140;
}
}