輸入出生年份,輸出生肖
參考解答:
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
產生50個元素的陣列並排序
-
11!=?
-
請輸出如下 * ** *** **** ***** ******
-
借錢500萬,年利18%,每月複利計算,請問連本帶利的金額 5, 10, 15, 20, 25, 30, 35, 40, 45, 50年的金額。並比較公式: A*exp(0.18n) A*(1+0.18/12)^(12*n), n=年數, A=本金 hint: math.h, p...
-
計算你上學期加權平均
-
計算你的BMI
-
寫一個是否上學期成績2/3的程式
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
金鑰總數159*10^18 億=10^8 兆=10^12 京=10^16 垓=10^20 秭=10^24 穣=10^28 溝=10^32 澗=10^36 正=10^40 載=10^44 極=10^48 恆河沙=10^52 阿僧祇=10^56 那由...

27 則留言:
import java.util.Scanner;
public class aa {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.print("輸入出生年");
x=input.nextInt();
y=(x-1600)%12;
if(y==0)
System.out.print("鼠");
else if(y==1)
System.out.print("牛");
else if(y==2)
System.out.print("虎");
else if(y==3)
System.out.print("兔");
else if(y==4)
System.out.print("龍");
else if(y==5)
System.out.print("蛇");
else if(y==6)
System.out.print("馬");
else if(y==7)
System.out.print("羊");
else if(y==8)
System.out.print("猴");
else if(y==9)
System.out.print("雞");
else if(y==10)
System.out.print("狗");
else if(y==11)
System.out.print("豬");
}
}
import java.util.Scanner;
public class ex01 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int x; int r;
Scanner input=new Scanner (System.in);
System.out.print("出生年份");
x=input.nextInt();
r=(x-1960)%12;
r=(r+12)%12;
if(r==0)
System.out.print("生肖鼠");
else if(r==1)
System.out.print("生肖牛") ;
else if(r==2)
System.out.print("生肖虎") ;
else if(r==3)
System.out.print("生肖兔") ;
else if(r==4)
System.out.print("生肖龍") ;
else if(r==5)
System.out.print("生肖蛇") ;
else if(r==6)
System.out.print("生肖馬") ;
else if(r==7)
System.out.print("生肖羊") ;
else if(r==8)
System.out.print("生肖猴") ;
else if(r==9)
System.out.print("生肖雞") ;
else if(r==10)
System.out.print("生肖狗") ;
else
System.out.print("生肖豬") ;
}
}
import java.util.Scanner;
public class c1 {
public static void main(String[] args) {
int x, j;
Scanner input =new Scanner(System.in);
System.out.println("請輸入(西元)年號");
x=input.nextInt();
j=(x-1960)%12;
System.out.println("生肖");
if(j==0)
System.out.println("鼠");
if(j==1)
System.out.println("牛");
if(j==2)
System.out.println("虎");
if(j==3)
System.out.println("兔");
if(j==4)
System.out.println("龍");
if(j==5)
System.out.println("蛇");
if(j==6)
System.out.println("馬");
if(j==7)
System.out.println("羊");
if(j==8)
System.out.println("猴");
if(j==9)
System.out.println("雞");
if(j==10)
System.out.println("狗");
if(j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class h14 {
public static void main(String[] args) {
int x,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960)+12)%12;
if (j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else
System.out.println("豬");
}
}
import java.util.Scanner;
public class house1016 {
public static void main(String[] args) {
int x, j;
Scanner input =new Scanner(System.in);
System.out.println("年號");
x=input.nextInt();
j=(x-1960)%12;
System.out.println("生肖");
if(j==0)
System.out.println("鼠");
if(j==1)
System.out.println("牛");
if(j==2)
System.out.println("虎");
if(j==3)
System.out.println("兔");
if(j==4)
System.out.println("龍");
if(j==5)
System.out.println("蛇");
if(j==6)
System.out.println("馬");
if(j==7)
System.out.println("羊");
if(j==8)
System.out.println("猴");
if(j==9)
System.out.println("雞");
if(j==10)
System.out.println("狗");
if(j==11)
System.out.println("豬");
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int x, j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960+12)%12);
if (j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else
System.out.println("豬");
}
}
import java.util.Scanner;
public class e19 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.println("出生年份");
x=input.nextInt();
y=((x-1960)+12)%12;
if(y==0)
System.out.println("鼠");
else if(y==1)
System.out.println("牛");
else if(y==2)
System.out.println("虎");
else if(y==3)
System.out.println("兔");
else if(y==4)
System.out.println("龍");
else if(y==5)
System.out.println("蛇");
else if(y==6)
System.out.println("馬");
else if(y==7)
System.out.println("羊");
else if(y==8)
System.out.println("猴");
else if(y==9)
System.out.println("雞");
else if(y==10)
System.out.println("狗");
else
System.out.println("豬");
}
}
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
int x,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960)+12)%12;
if (j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
int x,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960)+12)%12;
if (j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class ex1016 {
public static void main(String[] args) {
int x,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960)+12)%12;
if (j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class ex1016 {
public static void main(String[] args) {
int x,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
x=input.nextInt();
j=((x-1960)+12)%12;
if(j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class vghj858 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.print("給我你的出生年份");
x=input.nextInt();
y=(x-1192)%12;
if (y==0)System.out.print("mouse");
else if (y==1)System.out.print("cow");
else if (y==2)System.out.print("tiger");
else if (y==3)System.out.print("rabbit");
else if (y==4)System.out.print("dragon");
else if (y==5)System.out.print("snake");
else if (y==6)System.out.print("horse");
else if (y==7)System.out.print("goat");
else if (y==8)System.out.print("monkey");
else if (y==9)System.out.print("chicken");
else if (y==10)System.out.print("dog");
else if (y==11)System.out.print("PIG");
}
}
import java.util.Scanner;
public class ex1 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.print("出生年:");
int x=input.nextInt();
int r;
r=(x-1960)%12;
r=(r+12)%12;
if (r==0) System.out.print("鼠年");
else if (r==1) System.out.print("牛年");
else if (r==2) System.out.print("虎年");
else if (r==3) System.out.print("兔年");
else if (r==4) System.out.print("龍年");
else if (r==5) System.out.print("蛇年");
else if (r==6) System.out.print("馬年");
else if (r==7) System.out.print("羊年");
else if (r==8) System.out.print("猴年");
else if (r==9) System.out.print("雞年");
else if (r==10) System.out.print("狗年");
else if (r==11) System.out.print("豬年");
}
}
import java.util.Scanner;
public class happy2 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.print("出生年份");
x=input.nextInt();
y=(x-1960)%12;
if (y==0)System.out.print("鼠");
else if (y==1)System.out.print("牛");
else if (y==2)System.out.print("虎");
else if (y==3)System.out.print("兔");
else if (y==4)System.out.print("龍");
else if (y==5)System.out.print("蛇");
else if (y==6)System.out.print("馬");
else if (y==7)System.out.print("羊");
else if (y==8)System.out.print("猴");
else if (y==9)System.out.print("雞");
else if (y==10)System.out.print("狗");
else if (y==11)System.out.print("豬");
}
}
import java.util.Scanner;
public class vghj858 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.print("給我你的出生年份");
x=input.nextInt();
y=(x-1192)%12;
if (y==0)System.out.print("mouse");
else if (y==1)System.out.print("cow");
else if (y==2)System.out.print("tiger");
else if (y==3)System.out.print("rabbit");
else if (y==4)System.out.print("dragon");
else if (y==5)System.out.print("snake");
else if (y==6)System.out.print("horse");
else if (y==7)System.out.print("goat");
else if (y==8)System.out.print("monkey");
else if (y==9)System.out.print("chicken");
else if (y==10)System.out.print("dog");
else if (y==11)System.out.print("PIG");
}
}
import java.util.Scanner;
public class vghj858 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.print("給我你的出生年份");
x=input.nextInt();
y=(x-1192)%12;
if (y==0)System.out.print("mouse");
else if (y==1)System.out.print("cow");
else if (y==2)System.out.print("tiger");
else if (y==3)System.out.print("rabbit");
else if (y==4)System.out.print("dragon");
else if (y==5)System.out.print("snake");
else if (y==6)System.out.print("horse");
else if (y==7)System.out.print("goat");
else if (y==8)System.out.print("monkey");
else if (y==9)System.out.print("chicken");
else if (y==10)System.out.print("dog");
else if (y==11)System.out.print("PIG");
}
}
import java.util.Scanner;
public class e029 {
public static void main(String[] args) {
int x,y;
Scanner input=new Scanner(System.in);
System.out.println("出生年份");
x=input.nextInt();
y=((x-1960)+12)%12;
if(y==0)
System.out.println("鼠");
else if(y==1)
System.out.println("牛");
else if(y==2)
System.out.println("虎");
else if(y==3)
System.out.println("兔");
else if(y==4)
System.out.println("龍");
else if(y==5)
System.out.println("蛇");
else if(y==6)
System.out.println("馬");
else if(y==7)
System.out.println("羊");
else if(y==8)
System.out.println("猴");
else if(y==9)
System.out.println("雞");
else if(y==10)
System.out.println("狗");
else
System.out.println("豬");
import java.util.Scanner;
public class A10433043 {
public static void main(String[] args) {
int X,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
X=input.nextInt();
j=((X-1960)+12)%12;
if(j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class A10433043 {
public static void main(String[] args) {
int X,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
X=input.nextInt();
j=((X-1960)+12)%12;
if(j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class A10433043 {
public static void main(String[] args) {
int X,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
X=input.nextInt();
j=((X-1960)+12)%12;
if(j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class A10433043 {
public static void main(String[] args) {
int X,j;
Scanner input=new Scanner(System.in);
System.out.println("請輸入年份");
X=input.nextInt();
j=((X-1960)+12)%12;
if(j==0)
System.out.println("鼠");
else if (j==1)
System.out.println("牛");
else if (j==2)
System.out.println("虎");
else if (j==3)
System.out.println("兔");
else if (j==4)
System.out.println("龍");
else if (j==5)
System.out.println("蛇");
else if (j==6)
System.out.println("馬");
else if (j==7)
System.out.println("羊");
else if (j==8)
System.out.println("猴");
else if (j==9)
System.out.println("雞");
else if (j==10)
System.out.println("狗");
else if (j==11)
System.out.println("豬");
}
}
import java.util.Scanner;
public class ex {
public static void main(String[] args) {
Scanner z =new Scanner(System.in );
System.out.print("輸入出生年份:");
int b=z.nextInt();
int x ;
x=(b-100)%12;
if (x==0) System.out.print("鼠");
else if (x==1) System.out.print("牛");
else if (x==2) System.out.print("虎");
else if (x==3) System.out.print("兔");
else if (x==4) System.out.print("龍");
else if (x==5) System.out.print("蛇");
else if (x==6) System.out.print("馬");
else if (x==7) System.out.print("羊");
else if (x==8) System.out.print("猴");
else if (x==9) System.out.print("雞");
else if (x==10) System.out.print("狗");
else if (x==11) System.out.print("豬");
}
import java.util.Scanner;
public class Ex01166 {
public static void main(String[] args) {
Scanner z=new Scanner(System.in);
System.out.print("輸入出生年份:");
int b=z.nextInt();
int x;
x=(b-1960)%12;
if(x==0)System.out.print("鼠");
else if(x==1)System.out.print("牛");
else if(x==2)System.out.print("虎");
else if(x==3)System.out.print("兔");
else if(x==4)System.out.print("龍");
else if(x==5)System.out.print("蛇");
else if(x==6)System.out.print("馬");
else if(x==7)System.out.print("羊");
else if(x==8)System.out.print("猴");
else if(x==9)System.out.print("雞");
else if(x==10)System.out.print("狗");
else if(x==11)System.out.print("豬");
}
}
import java.util.Scanner;
public class a123 {
public static void main(String[] args) {
System.out.print("出生年份");
Scanner input=new Scanner(System.in);
int x=input.nextInt();
x=(x-1960)%12;
if(x<0) x+=12;
String xx="鼠牛虎兔龍蛇馬羊猴雞狗豬";
System.out.println(xx.charAt(x));
}
}
package jimmy;
import java.util.Scanner;
public class good {
public static void main(String[] args) {
Scanner a =new Scanner(System.in);
System.out.print("輸入出生年份:");
int b= a.nextInt();
int c; c=(b-1960)%12;
if (c==0)System.out.print("鼠");
else if(c==1)System.out.print("牛");
else if(c==2)System.out.print("虎");
else if(c==3)System.out.print("兔");
else if(c==4)System.out.print("龍");
else if(c==5)System.out.print("蛇");
else if(c==6)System.out.print("馬");
else if(c==7)System.out.print("羊");
else if(c==8)System.out.print("侯");
else if(c==9)System.out.print("雞");
else if(c==10)System.out.print("狗");
else if(c==11)System.out.print("豬");
package jimmy;
import java.util.Scanner;
public class good {
public static void main(String[] args) {
Scanner a =new Scanner(System.in);
System.out.print("輸入出生年份:");
int b= a.nextInt();
int c; c=(b-1960)%12;
if (c==0)System.out.print("鼠");
else if(c==1)System.out.print("牛");
else if(c==2)System.out.print("虎");
else if(c==3)System.out.print("兔");
else if(c==4)System.out.print("龍");
else if(c==5)System.out.print("蛇");
else if(c==6)System.out.print("馬");
else if(c==7)System.out.print("羊");
else if(c==8)System.out.print("侯");
else if(c==9)System.out.print("雞");
else if(c==10)System.out.print("狗");
else if(c==11)System.out.print("豬");
}
}
package jimmy;
import java.util.Scanner;
public class good {
public static void main(String[] args) {
Scanner a =new Scanner(System.in);
System.out.print("輸入出生年份:");
int b= a.nextInt();
int c; c=(b-1960)%12;
if (c==0)System.out.print("鼠");
else if(c==1)System.out.print("牛");
else if(c==2)System.out.print("虎");
else if(c==3)System.out.print("兔");
else if(c==4)System.out.print("龍");
else if(c==5)System.out.print("蛇");
else if(c==6)System.out.print("馬");
else if(c==7)System.out.print("羊");
else if(c==8)System.out.print("侯");
else if(c==9)System.out.print("雞");
else if(c==10)System.out.print("狗");
else if(c==11)System.out.print("豬");
}
}
張貼留言