回答編集履歴
2
LocalDateTimeを使う意味がないためLocalDateに変更
test
CHANGED
@@ -32,10 +32,10 @@
|
|
32
32
|
|
33
33
|
```Java
|
34
34
|
|
35
|
-
LocalDate
|
35
|
+
LocalDate date = LocalDate.of(year, month, day);
|
36
36
|
|
37
|
-
String formattedDate = date
|
37
|
+
String formattedDate = date.format(DateTimeFormatter.ofPattern("u:M:d:E", Locale.ENGLISH));
|
38
38
|
|
39
|
-
System.out.println(formattedDate + String.format(":(%d/365)", date
|
39
|
+
System.out.println(formattedDate + String.format(":(%d/365)", date.getDayOfYear()));
|
40
40
|
|
41
41
|
```
|
1
追記
test
CHANGED
@@ -23,3 +23,19 @@
|
|
23
23
|
count = count + day;
|
24
24
|
|
25
25
|
```
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
以下に、答え合わせ用のコードを置いときます。
|
30
|
+
|
31
|
+
この出力結果と同じであれば正解です。
|
32
|
+
|
33
|
+
```Java
|
34
|
+
|
35
|
+
LocalDateTime dateTime = LocalDateTime.of(year, month, day, 0, 0);
|
36
|
+
|
37
|
+
String formattedDate = dateTime.format(DateTimeFormatter.ofPattern("u:M:d:E", Locale.ENGLISH));
|
38
|
+
|
39
|
+
System.out.println(formattedDate + String.format(":(%d/365)", dateTime.getDayOfYear()));
|
40
|
+
|
41
|
+
```
|