回答編集履歴

1

static を追加

2021/05/14 01:17

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  {
22
22
 
23
- int monthdays[] = { 365,393,59,90,120,151,181,212,243,273,304,334 };
23
+ static int monthdays[] = { 365,393,59,90,120,151,181,212,243,273,304,334 };
24
24
 
25
25
  if (month < 3) year--;
26
26
 
@@ -38,7 +38,7 @@
38
38
 
39
39
  int year, month, day;
40
40
 
41
- int eachmonth[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
41
+ static int eachmonth[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
42
42
 
43
43
  printf("記念日の西暦を入力してください: ");
44
44