Created
July 11, 2012 10:53
Revisions
-
skRyo revised this gist
Jul 11, 2012 . 1 changed file with 14 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ /* * 西暦年が4で割り切れる年は閏年 ただし、西暦年が100で割り切れる年は平年 @@ -7,18 +6,18 @@ */ public class gregoriano { public static void main(String[] args) { int x = 1000; for ( int i = 1; i <= x; i++ ){ if ( i%4==0 ){ if ( i%400==0 || i%100!=0 ){ System.out.println(i + " 閏年みたいだよ"); }else{ System.out.println(i); } }else{ System.out.println(i); } } } } -
skRyo created this gist
Jul 11, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ /* * 西暦年が4で割り切れる年は閏年 ただし、西暦年が100で割り切れる年は平年 ただし、西暦年が400で割り切れる年は閏年 * */ public class gregoriano { public static void main(String[] args) { int x = 1000; for ( int i = 1; i <= x; i++ ){ if ( i%4==0 ){ if ( i%400==0 || i%100!=0 ){ System.out.println(i + " 閏年みたいだよ"); }else{ System.out.println(i); } }else{ System.out.println(i); } } } }