質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,46 +20,66 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|import java.io.*;|
|
24
23
|
|
25
|
-
|:----|
|
26
24
|
|
27
|
-
|
25
|
+
```Java
|
28
26
|
|
29
|
-
|
27
|
+
import java.io.*;
|
30
28
|
|
31
|
-
|
29
|
+
import java.lang.*;
|
32
30
|
|
33
|
-
|
31
|
+
public class Sankome{
|
34
32
|
|
35
|
-
|
33
|
+
public static void main(String[] args){
|
36
34
|
|
37
|
-
|
35
|
+
BufferedReader br =
|
38
36
|
|
39
|
-
|
37
|
+
new BufferedReader(new InputStreamReader(System.in));
|
40
38
|
|
41
|
-
|
39
|
+
String str1,str2,str3,str4;
|
42
40
|
|
43
|
-
|
41
|
+
int num1,num2,num3,num4,result;
|
44
42
|
|
45
|
-
|str2 = br.readLine();str3 = br.readLine();str4 = br.readLine();|
|
46
43
|
|
47
|
-
|num1 = integer.parselnt(str1);num2 = integer.parselnt(str2);|
|
48
44
|
|
49
|
-
|
45
|
+
try {
|
50
46
|
|
51
|
-
|num4 = integer.parselnt(str4);|
|
52
47
|
|
53
|
-
|result = (num1 + num2 + num3 + num4) / 4;|
|
54
48
|
|
55
|
-
|
49
|
+
str1 = br.readLine();
|
56
50
|
|
57
|
-
|
51
|
+
str2 = br.readLine();
|
58
52
|
|
59
|
-
|
53
|
+
str3 = br.readLine();
|
60
54
|
|
61
|
-
|
55
|
+
str4 = br.readLine();
|
62
56
|
|
63
|
-
|
57
|
+
|
64
58
|
|
59
|
+
num1 = integer.parselnt(str1);
|
60
|
+
|
61
|
+
num2 = integer.parselnt(str2);
|
62
|
+
|
63
|
+
num3 = integer.parselnt(str3);
|
64
|
+
|
65
|
+
num4 = integer.parselnt(str4);
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
result = (num1 + num2 + num3 + num4) / 4;
|
70
|
+
|
71
|
+
System.out.println("四ヶ月分のアルバイト料の平均は" + result + "円です");
|
72
|
+
|
65
|
-
|
73
|
+
}
|
74
|
+
|
75
|
+
catch(IOException ioe){
|
76
|
+
|
77
|
+
System.out.println(e.getMessage());
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
```
|
1
マークダウンにしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,60 +20,46 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
import java.io.*;
|
23
|
+
|import java.io.*;|
|
24
24
|
|
25
|
-
|
25
|
+
|:----|
|
26
26
|
|
27
|
-
p
|
27
|
+
|import java.lang.*;|
|
28
28
|
|
29
|
-
|
29
|
+
|public class Sankome{|
|
30
30
|
|
31
|
-
|
31
|
+
| public static void main(String[] args){|
|
32
32
|
|
33
|
-
|
33
|
+
| BufferedReader br =|
|
34
34
|
|
35
|
-
|
35
|
+
| new BufferedReader(new InputStreamReader(System.in));|
|
36
36
|
|
37
|
-
int
|
37
|
+
| String str1,str2,str3,str4;|
|
38
38
|
|
39
|
+
| int num1,num2,num3,num4,result;|
|
39
40
|
|
41
|
+
|try {|
|
40
42
|
|
41
|
-
|
43
|
+
|str1 = br.readLine();|
|
42
44
|
|
45
|
+
|str2 = br.readLine();str3 = br.readLine();str4 = br.readLine();|
|
43
46
|
|
47
|
+
|num1 = integer.parselnt(str1);num2 = integer.parselnt(str2);|
|
44
48
|
|
45
|
-
|
49
|
+
|num3 = integer.parselnt(str3);|
|
46
50
|
|
47
|
-
|
51
|
+
|num4 = integer.parselnt(str4);|
|
48
52
|
|
49
|
-
|
53
|
+
|result = (num1 + num2 + num3 + num4) / 4;|
|
50
54
|
|
51
|
-
|
55
|
+
|System.out.println("四ヶ月分のアルバイト料の平均は" + result + "円です");}|
|
52
56
|
|
53
|
-
|
57
|
+
|catch(IOException ioe){|
|
54
58
|
|
55
|
-
|
59
|
+
|System.out.println(e.getMessage());|
|
56
60
|
|
57
|
-
|
61
|
+
|} |
|
58
62
|
|
59
|
-
|
63
|
+
|}|
|
60
64
|
|
61
|
-
num4 = integer.parselnt(str4);
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
result = (num1 + num2 + num3 + num4) / 4;
|
66
|
-
|
67
|
-
System.out.println("四ヶ月分のアルバイト料の平均は" + result + "円です");
|
68
|
-
|
69
|
-
|
65
|
+
|}|
|
70
|
-
|
71
|
-
catch(IOException ioe){
|
72
|
-
|
73
|
-
System.out.println(e.getMessage());
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
}
|
78
|
-
|
79
|
-
}
|