2日目
This commit is contained in:
@@ -5,7 +5,7 @@ public class StringCheck_20261007福森 {
|
||||
public static void main(String[] args) {
|
||||
// TODO 自動生成されたメソッド・スタブ
|
||||
|
||||
//段階1
|
||||
//画面に「いまなにしてる?」を表示する
|
||||
args = new String [4];
|
||||
|
||||
args[0] = "いまなにしてる?";
|
||||
@@ -14,20 +14,15 @@ public class StringCheck_20261007福森 {
|
||||
args[3] = "↓↓↓↓↓↓ 投稿されました ↓↓↓↓↓↓";
|
||||
System.out.println(args[0]);
|
||||
|
||||
//段階2
|
||||
//文字列を入力させる
|
||||
Scanner sc = new Scanner(System.in);
|
||||
String str = sc.next();
|
||||
|
||||
String text = str;
|
||||
System.out.println("");
|
||||
|
||||
System.out.println(args[3]);
|
||||
System.out.println(str);
|
||||
|
||||
//段階3
|
||||
//文字数を数える
|
||||
int count = text.length();
|
||||
System.out.println(count);
|
||||
|
||||
//空文字判定:str の文字数が 0 かどうか
|
||||
boolean num;
|
||||
int nums = count;
|
||||
@@ -47,7 +42,25 @@ public class StringCheck_20261007福森 {
|
||||
rest = 140 - count;
|
||||
System.out.println(rest);
|
||||
|
||||
//投稿完了
|
||||
System.out.println(args[3]);
|
||||
System.out.println(str);
|
||||
|
||||
//ここから
|
||||
System.out.println("いまなにしてる?");
|
||||
|
||||
for (int i = 0 ; i < 4; i++) {
|
||||
System.out.println("今は" + i + "です");
|
||||
|
||||
if (i == 2) {
|
||||
System.out.println("for文を抜けます");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user