陽曆曆法
臺灣目前使用的曆法為陰陽合曆。其中陽曆的部分,年的制訂是利用太陽的運動而來,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)
熱門文章
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
python pandas對黃金、外匯匯率的爬蟲練習,並使用matplotlib.pyplot的函數plot, scatter做資料視覺化處理,採用numpy的統計函數,分析黃金價格波動與歐元走勢的關聯。
-
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String 多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例...
-
你會用C的算子sizeof?
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("平年");
}
}
}
張貼留言