陽曆曆法
臺灣目前使用的曆法為陰陽合曆。其中陽曆的部分,年的制訂是利用太陽的運動而來,1回歸年(或太陽年)實際長度為365.24219天,陽曆曆法上的1年長度為365天,每年會因而多出0.24219天(相當於5.8小時),如此一來,累積4年後為0.96876天,幾近1天,為修正之,故國曆曆法中有「閏年」制度,每4年會多2月29日這一天。
然而,累積4年後多的0.96876天,與真正的1日尚差0.03124天,故如果不間斷地按4年1閏的方式修正,百年後將累積成365×100+25=36525日,比真正的1世紀日數365.24219×100=36524.219多。
因此曆法學家便重新規定閏年的規則為:西元年份逢4的倍數閏、100的倍數不閏、400的倍數閏、4000的倍數不閏。例如:西元1992、1996年等為4的倍數,故為閏年;西元1700、1800、1900年為100的倍數,當年不閏年;西元1600、2000、2400年為400的倍數,有閏;而西元4000、8000年為4000的倍數,則不閏。
出處:http://tamweb.tam.gov.tw/news/2010/201002/news2010020904.htm
herrDeng網內搜尋
自訂搜尋
Ads
2012年3月7日 星期三
閏年的判斷程式
請照下列台北天文台陽年閏年說明,寫一判斷輸入公元n年(n>0)是否為閏年的判斷程式。
訂閱:
張貼留言 (Atom)
熱門文章
-
11!=?
-
計算你上學期加權平均
-
計算你的BMI
-
int a[]={21, 23, 57, 13 ,17, 6}; float average; average=?
-
輸出字串20次
-
猜數字
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
37 則留言:
import java.util.*;
public class n {
public static void main(String[] args)
throws Exception
{
Scanner sc = new Scanner(System.in);
System.out.println("請輸入年份=> ");
int n = sc.nextInt();
if(n%4000==0)
System.out.println("平年");
else if (n%400==0)
System.out.println("閏年");
else if (n%100==0)
System.out.println("平年");
else if (n%4==0)
System.out.println("閏年");
else System.out.println("平年");
}
}
import java.util.*;
public class useScanner {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else
System.out.println("平年");
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main (String [] args){
int n;
Scanner SC=new Scanner (System.in);
n=SC.nextInt();
if(n%4000==0){
System.out.println("平");
}
else if (n%400==0){
System.out.println("閏");
}
else if (n%100==0){
System.out.println("平");
}
else if (n%4==0){
System.out.println("閏");
}
else {
System.out.println("平");
}
}
}
import java.util.*;
public class useScanner {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String [] args) throws Exception {
Scanner sc=new Scanner(System.in);
System.out.println("請輸入年份=");
int n=sc.nextInt();
if(n%4000==0){
System.out.println("平");
}
else if(n%400==0){
System.out.println("閏");
}
else if(n%100==0){
System.out.println("平");
}
else if(n%4==0){
System.out.println("閏");
}
else{
System.out.println("平");
}
}
}
import java.util.*;
public class hello {
public static void main(String [] args)throws Exception {
Scanner sc=new Scanner (System.in);
System.out.println(請輸入年份=");
if(n%4000==0){
System.out.println("平");
}
else if(n%400==0)}{
System.out.println("閏");
}
else if(n%100==0){
System.out.println("平");
}
else if(n%4==0){
System.out.println("閏");
}
else{
System.out.println("平");
}
}
}
import java.util.*;
public class useScanner1 {
public static void main (String [] args) {
Scanner sc=new Scanner (System.in);
System.out.print("請輸入年份=>");
int year = sc.nextInt();
if(year%4000==0){
System.out.println("平年");
}
else if (year%400==0){
System.out.println("閏年");
}
else if (year%100==0){
System.out.println("平年");
}
else if (year%4==0){
System.out.println("閏年");
}
else System.out.println("平年");
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class good {
public static void main(string[] args) {
Scanner sc = new java.util.Scanner(System.in);
int i = sc.nextInt();
if( i%4000==0)
System.out.println("平年");
else if (i%400==0)
System.out.println("閏年");
else if (i%100==0)
System.out.println("平年");
else if (1%4==0)
System.out.println("閏年");
else
System.out.println("平年");
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
⋯⋯ new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class Test {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("請輸入西元元年份:");
while( sc.hasNext() ){
int a = sc.nextInt();
if( (a % 4 == 0 && a % 100 != 0) || a % 400 == 0 )
System.out.println("閏年");
else
System.out.println("平年");
System.out.println("請輸入西元元年份:");
}
}
}
import java.util.*;
public class yy {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份:");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class yy {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class test {
public static void main(String[] args) {
java.util.Scanner sc =
newjava.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class test {
public static void main (String [] args) {
java.util.Scanner sc=
new java.util.Scanner(System.in);
System.out.print("請輸入年份");
int n=sc.nextInt();
if (n%4000==0) {
System.out.println("平年");
}
else if (n%400==0) {
System.out.println("閏年");
}
else if (n%100==0) {
System.out.println("平年");
}
else if (n%4==0) {
System.out.println("閏年");
}
else {
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int n = sc.nextInt();
if( n%4000==0) {
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello{
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class Hello{
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class yy {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.Scanner;
public class year{
public static void main(String[] args){
int year = 0;
Scanner scanner = new Scanner(System.in);
System.out.printf("請輸入西洋年:");
year= scanner.nextInt();
if(year % 4 == 0){
if(year % 100 ==0){
if( year % 400 ==0){
if( year % 4000 ==0)
System.out.printf("%d 是平年哦",year);
else
System.out.printf("%d 是閏年耶...",year);
}
else
System.out.printf("%d 是平年哦",year);
}
else
System.out.printf("%d 是閏年耶...",year);
}
else
System.out.printf("%d 是平年哦",year);
}
}
import java.util.*;
public class n {
public static void main(String[] args)
throws Exception
{
Scanner sc = new Scanner(System.in);
System.out.println("請輸入年份=> ");
int n = sc.nextInt();
if(n%4000==0)
System.out.println("平年");
else if (n%400==0)
System.out.println("閏年");
else if (n%100==0)
System.out.println("平年");
else if (n%4==0)
System.out.println("閏年");
else System.out.println("平年");
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class test {
public static void main(String[] args) {
java.util.Scanner sc =
new java.util.Scanner(System.in);
System.out.print("請輸入西年年份");
int i = sc.nextInt();
if( i%4000==0) {
System.out.println("平年");
}
else if (i%400==0){
System.out.println("閏年");
}
else if (i%100==0){
System.out.println("平年");
}
else if (i%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class useScanner{
public static void main(String[]args)
{
int n;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
import java.util.*;
public class tred {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n%4000==0){
System.out.println("平年");
}
else if (n%400==0){
System.out.println("閏年");
}
else if (n%100==0){
System.out.println("平年");
}
else if (n%4==0){
System.out.println("閏年");
}
else{
System.out.println("平年");
}
}
}
張貼留言