herrDeng網內搜尋

自訂搜尋

Ads

2015年5月11日 星期一

Ex6 輸入公元n年,輸出"平年" "閏年"

輸入公元n年,輸出"平年" "閏年"

38 則留言:

D10333009_張賢青 提到...

import java.util.Scanner;

class JAVA
{

public static void main(String[] args)
{
Scanner Scanner = new Scanner(System.in);
while (Scanner.hasNext())
{
int x = Scanner.nextInt();
if (( x % 4 == 0 && x % 100 != 0) || x % 400 == 0 )
System.out.println("閏年");
else
System.out.println("平年");
}
}
}

D10333039邱嘉琪 提到...

import java.util.Scanner;


public class HIHI {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int x=input.nextInt();
if(x%400==0)
System.out.println("閏年");
else if(x%100==0)
System.out.println("平年");
else if(x%4==0)
System.out.println("閏年");
else
System.out.println("平年");
}

}

D10033003陳志翔 提到...

import java.util.Scanner;
public class D10033003 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a=input.nextInt();
if(a%400==0)
System.out.print("閏年");
else if(a%100==0)
System.out.print("平年");
else if(a%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}
}

D10333008王旭翔 提到...

import java.util.Scanner;


public class joneswang1314 {

public static void main(String[] args) {
Scanner Input=new Scanner(System.in);
int x=Input.nextInt();
if(x%400==0)
System.out.print("潤年");
else if(x%100==0)
System.out.print("平年");
else if(x%4==0)
System.out.print("閏年");
else
System.out.print("平年");



}

}

D10033305呂健宏 提到...

import java.util.Scanner;


public class BADBOY {

public static void main(String[] args) {

Scanner input= new Scanner(System.in);
int a=input.nextInt();
if(a%400==0)
System.out.print("潤");
else if(a%100==0)
System.out.print("平");
else if(a%4==0)
System.out.print("潤");
else
System.out.print("平");

}

}

D10033029吳武俊 提到...

import java.util.*;
public class D10033029_5
{
public static void main(String[] args)
{
int year,rem4,rem100,rem400;

Scanner scanner = new Scanner(System.in);
System.out.print("請輸入年份: ");
year = scanner.nextInt();
System.out.println();

rem4 = year % 4;
rem100 = year % 100;
rem400 = year % 400;

/* 巢狀if */
if ( rem4 == 0)
{
if ( rem100 == 0 )
{
if ( rem400 == 0)
{
System.out.println(year + "該年分為閏年");
}
else
{
System.out.println(year + "該年分為平年");
}
}
else
{
System.out.println(year + "該年分為閏年");
}

}
else
{
System.out.println(year + "該年分為平年");


}
}


}


D10333012 范秀娟 提到...

import java.util.Scanner;


public class EX2 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

D10333016 提到...

public class dfg6666 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");
}

}

D10233203邱秀蓉 提到...

import java.util.Scanner;


public class ex2 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if(n%4!=0)System.out.println("平年");
else if(n%400==0)System.out.println("閏年");
else if(n%100==0)System.out.println("平年");
else System.out.println("閏年");

}

}

D10333022 提到...

public class YAYA123456 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");
}

}

Y10310054 提到...

public class KKK {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");
}

}

D10333037 楊茗程 提到...

import java.util.Scanner;

public class Promise520520 {

public static void main(String[] args) {
{
Scanner Scanner=new Scanner(System.in);
while (Scanner.hasNext())
{
int x=Scanner.nextInt();
if ((x%4==0&&x%100!=0)||x%400==0)
System.out.println("閏年");
else
System.out.println("平年");
}
}

}
}

D10333030張佑榕 提到...

import java.util.Scanner;


public class fghgfh {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0) System.out.println("平年");
else if (n%400==0) System.out.println("閏年");
else if (n%100==0) System.out.println("平年");
else System.out.println("閏年");

y10310024陳穎慧 提到...

import java.util.Scanner;

/*
* 輸入公元n年,輸出"平年" "閏年"
*/
public class a {
public static void main(String[] args)
{
//System.out.println("請輸入公元年,可以分辨平年或閏年:");

Scanner scr;
scr=new Scanner(System.in);

int s =scr.nextInt();
if(s%4!=0)
System.out.println("平年");
else if(s%400==0)
System.out.println("閏年");
else if(s%100==0)
System.out.println("平年");
else
System.out.println("閏年");
}
}

D10333012 范秀娟 提到...

import java.util.Scanner;


public class EX2 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

D10333001 羅原福 提到...

import java.util.Scanner;
public class happy {

public static void main(String[] args) {
Scanner Scanner=new Scanner(System.in);
while (Scanner.hasNext())
{
int x =Scanner.nextInt();
if (( x % 4 == 0 && x % 100 != 0) || x % 400 == 0)
System.out.println("閏年");
else
System.out.println("平年");
}
}

}

D10333007馮婷鈺 提到...


import java.util.Scanner;

public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

D10333010 柯羿瑄 提到...

D10333010 柯羿瑄



import java.util.Scanner;

public class hioo {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0) System.out.println("平年");
else if (n%400==0) System.out.println("閏年");
else if (n%100==0) System.out.println("平年");
else System.out.println("閏年");

}

}

D10333040王崇安 提到...


import java.util.Scanner;

public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

江淑婷 D10333033 提到...

import java.util.Scanner;


public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0) System.out.println("平年");
else if (n%400==0) System.out.println("閏年");
else if (n%100==0) System.out.println("平年");
else System.out.println("閏年");

}

}

D10333014邱宜貞 提到...

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int x=input.nextInt();
if(x%400==0)
System.out.println("閏年");
else if(x%100==0)
System.out.println("平年");
else if(x%4==0)
System.out.println("閏年");
else
System.out.println("平年");
}

}

Y10310066 陳昤瑄 提到...

y10310066 陳昤瑄

import java.util.Scanner;
public class sdf {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0)System.out.println("平年");
else if (n%400==0)System.out.println("閏年");
else if (n%100==0)System.out.println("平年");
else System.out.println("閏年");

}

}

洪芷茵D10333034 提到...

import java.util.Scanner;


public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0) System.out.println("平年");
else if (n%400==0) System.out.println("閏年");
else if (n%100==0) System.out.println("平年");
else System.out.println("閏年");

}

}

B10033104賴奕隆 提到...

Scanner input =new Scanner(System.in);
int n = input.nextInt();
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("平年");

D10333004 夏志明 提到...

package hello;

import java.util.Scanner;

public class Jimmy0511 {

public static void main(String[] args) {

Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%400==0)
System.out.print("閏年");
else if(n%100==0)
System.out.print("平年");
else if(n%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}
}

D10333003盛采彤 提到...

import java.util.Scanner;


public class NINI2 {

public static void main(String[] args) {
Scanner Input=new Scanner(System.in);
int x=Input.nextInt();
if(x%400==0)
System.out.print("閏年");
else if(x%100==0)
System.out.print("平年");
else if(x%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}
}

D10333015陳韻萱 提到...

import java.util.Scanner;


public class D10333015 {

public static void main(String[] args) {
Scanner Input=new Scanner(System.in);
int x=Input.nextInt();
if(x%400==0)
System.out.print("閏年˙");
else if(x%100==0)
System.out.print("平年");
else if(x%4==0)
System.out.print("閏年");
else
System.out.print("平年");

}
}

D10333002徐國智 提到...

import java.util.Scanner;
public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if (n%4!=0) System.out.println("平年");
else if(n%400==0) System.out.println("閏年");
else if(n%100==0) System.out.println("平年");
else System.out.println("閏年");
}

}

B10033077陳光浩 提到...

import java.util.Scanner;

public class HW01 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();

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("平年");
}

}

D9933084陳睿喆 提到...

import java.util.Scanner;

public class HW01 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();

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("平年");
}

}

D10333017廖俊齊 提到...

package cc123;

import java.util.Scanner;

public class bb123 {

public static void main(String[] args) {
Scanner Input=new Scanner(System.in);
int x=Input.nextInt();
if(x%400==0)
System.out.print("閏年");
else if(x%100==0)
System.out.print("平年");
else if(x%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}

}

10333049洪竫暄 提到...

import java.util.Scanner;


public class hi {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

d10033093葉正傑 提到...

import java.util.Scanner;
public class D10033093 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a=input.nextInt();
if(a%400==0)
System.out.print("閏年");
else if(a%100==0)
System.out.print("平年");
else if(a%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}
}

匿名 提到...

D10033301 江姿穎提到...
import java.util.Scanner;
public class D10033003 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a=input.nextInt();
if(a%400==0)
System.out.print("閏年");
else if(a%100==0)
System.out.print("平年");
else if(a%4==0)
System.out.print("閏年");
else
System.out.print("平年");
}
}

D10333013吳竑逸 提到...

import java.util.Scanner;


public class EX2 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
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("平年");

}

}

D10033303 謝凱宇 提到...

import java.util.Scanner;


public class wa {

public static void main(String[] args) {

Scanner input= new Scanner(System.in);
int a=input.nextInt();
if(a%400==0)
System.out.print("潤");
else if(a%100==0)
System.out.print("平");
else if(a%4==0)
System.out.print("潤");
else
System.out.print("平");

}

}

D10333038歐俊吉 提到...

import java.util.Scanner;

public class Hey {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();

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("平年");
}

}

D10033203黃琮崴 提到...

public class HIHI {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int x=input.nextInt();
if(x%400==0)
System.out.println("閏年");
else if(x%100==0)
System.out.println("平年");
else if(x%4==0)
System.out.println("閏年");
else
System.out.println("平年");
}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章