段階2です
This commit is contained in:
@@ -11,46 +11,36 @@ public class StringCheck {
|
|||||||
|
|
||||||
//System.out.println(message[2]);
|
//System.out.println(message[2]);
|
||||||
|
|
||||||
|
// for (int i = 0; i < message.length; i++) {
|
||||||
for (int i = 0; i < message.length; i++) {
|
// System.out.println(message[i]);
|
||||||
System.out.println(message[i]);
|
// }
|
||||||
}
|
|
||||||
|
while (true) {
|
||||||
while(true) {
|
|
||||||
Scanner scanner = new Scanner(System.in);
|
Scanner scanner = new Scanner(System.in);
|
||||||
System.out.println(message[0]);
|
System.out.println(message[0]);
|
||||||
String str = scanner.nextLine().strip();
|
String str = scanner.nextLine().strip();
|
||||||
|
|
||||||
System.out.println("");
|
int strlen = str.length();
|
||||||
System.out.println(message[3]);
|
boolean isEmpty = strlen == 0;
|
||||||
System.out.println(str);
|
boolean isOver = ((140 - strlen) <= 0);
|
||||||
|
|
||||||
|
if (isEmpty == true) {
|
||||||
|
System.out.println(message[1]);
|
||||||
|
continue;
|
||||||
|
// System.out.println(isEmpty);
|
||||||
|
} else if (isOver == true) {
|
||||||
|
System.out.println(message[2]);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
System.out.println("");
|
||||||
|
System.out.println(message[3]);
|
||||||
|
System.out.println(str);
|
||||||
|
} break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// int strlen = str.length();
|
|
||||||
//
|
|
||||||
// boolean isEmpty = strlen == 0;
|
|
||||||
// System.out.println(message[1]);
|
|
||||||
// System.out.println(isEmpty);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// boolean isOver = ((140 - strlen) <= 0);
|
|
||||||
// //System.out.println(message[2]);
|
|
||||||
// System.out.println(isOver);
|
|
||||||
//
|
|
||||||
// System.out.println("残り入力可能文字数" + (140-strlen));
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// boolean isMessage = (140 >= strlen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// System.out.println("残り入力可能文字数" + (140-strlen));
|
||||||
|
|
||||||
|
// boolean isMessage = (140 >= strlen);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user