teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

変えました

2021/04/17 05:35

投稿

Hidama
Hidama

スコア2

title CHANGED
File without changes
body CHANGED
@@ -4,11 +4,12 @@
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
6
 
7
-
8
7
  ```
9
8
  lineがString型になっているらしいです
10
9
  なのでint型に変える方法を教えてください
11
10
  つまり型不一致です
11
+ ###試したこと
12
+ Stringからintに変えてみました
12
13
  ```Java
13
14
  ソースコード
14
15
  package 勉強;

4

変えました

2021/04/17 05:35

投稿

Hidama
Hidama

スコア2

title CHANGED
File without changes
body CHANGED
@@ -8,7 +8,7 @@
8
8
  ```
9
9
  lineがString型になっているらしいです
10
10
  なのでint型に変える方法を教えてください
11
-
11
+ つまり型不一致です
12
12
  ```Java
13
13
  ソースコード
14
14
  package 勉強;

3

変えました

2021/04/17 05:30

投稿

Hidama
Hidama

スコア2

title CHANGED
File without changes
body CHANGED
@@ -6,7 +6,8 @@
6
6
 
7
7
 
8
8
  ```
9
- lineがString型になっているのでint型に変えてほしいです
9
+ lineがString型になっているしいです
10
+ なのでint型に変える方法を教えてください
10
11
 
11
12
  ```Java
12
13
  ソースコード

2

変えました

2021/04/17 05:24

投稿

Hidama
Hidama

スコア2

title CHANGED
File without changes
body CHANGED
@@ -26,7 +26,7 @@
26
26
  System.out.println("Please input number");
27
27
  ここです
28
28
             ↓
29
- String line = reader.readLine();
29
+ int line = reader.readLine();
30
30
 
31
31
  if(isEven( line )) {
32
32
  System.out.println(line +"は偶数です");

1

int から Stringに変えました

2021/04/17 05:06

投稿

Hidama
Hidama

スコア2

title CHANGED
File without changes
body CHANGED
@@ -26,7 +26,7 @@
26
26
  System.out.println("Please input number");
27
27
  ここです
28
28
             ↓
29
- int line = reader.readLine();
29
+ String line = reader.readLine();
30
30
 
31
31
  if(isEven( line )) {
32
32
  System.out.println(line +"は偶数です");