猿问

swich为什么一直print停不下来?

public static void main(String[] args) {

Scanner s= new Scanner(System.in);

System.out.println("请按输入您的生日的年份,如‘2020’");

year = s.nextInt();

while(year>1900&&year<2020) {

System.out.println("请按输入您的生日的年份,如‘3’");

month = s.nextInt();

if(month>=1&&month<=12) {

System.out.println("请按输入您的生日的日期,如‘24’");

date = s.nextInt();

while(date>0&&date<32) {

switch(month) {

case 1:

if(date<20) {

System.out.println("您的生日是摩羯座");

break;

}else {

System.out.println("您的生日是水瓶座");

}

break;

case 2:

if(date<30&&year%4==0) {

if(date<19) {

System.out.println("您的生日是水瓶座");

}else {

System.out.println("您的生日是双鱼座");

}

}else {

System.out.println("请再次检查您的输入");

}

break;

case 3:

if(date<20) {

System.out.println("您的生日是双鱼座");

}else {

System.out.println("您的生日是白羊座");

}

break;

case 4:

if(date<31) {

if(date<20) {

System.out.println("您的生日是白羊座");

}else {

System.out.println("您的生日是金牛座");

}

}else {

System.out.println("请再次检查您的输入");

}

break;

case 5:

if(date<21) {

System.out.println("您的生日是金牛座");

}else {

System.out.println("您的生日是双子座");

}

break;

case 6:

if(date<31) {

if(date<22) {

System.out.println("您的生日是双子座");

}else {

System.out.println("您的生日是巨蟹座");

}

}else {

System.out.println("请再次检查您的输入");

}

break;

case 7:

if(date<23) {

System.out.println("您的生日是巨蟹座");

}else {

System.out.println("您的生日是狮子座");

}

break;

case 8:

if(date<23) {

System.out.println("您的生日是狮子座");

}else {

System.out.println("您的生日是处女座");

}

break;

case 9:

if(date<31) {

if(date<23) {

System.out.println("您的生日是处女座");

}else {

System.out.println("您的生日是天秤座");

}

}else {

System.out.println("请再次检查您的输入");

}

break;

case 10:

if(date<24) {

System.out.println("您的生日是天秤座");

}else {

System.out.println("您的生日是天蝎座");

}

break;

case 11:

if(date<31) {

if(date<23) {

System.out.println("您的生日是天蝎座");

}else {

System.out.println("您的生日是射手座");

}

}else {

System.out.println("请再次检查您的输入");

}

break;

case 12:

if(date<22) {

System.out.println("您的生日是射手座");

}else {

System.out.println("您的生日是摩羯座");

}

break;

}

}

}

}

}


钱君博
浏览 2025回答 0
0回答

慕斯4360584

DNXJOELUUYBDAQGDJZQZGGNMGPCNMEXTQSNADHNBCWZCQZPFIIOETQQKFVGGDVLFPDIXEEVFCHDQTUNNOOFHVIPPDGGMGULRUUHZJGXTXYVCCFDJEOFCJUHBSZJPCGGKHHPJKNUHHUYKRISZBIPKAOELMGPFAAUOPJMSWHAKEXXBEYIRMCSXNEANEOFLQNQRNRYYHXVNNYFJQNTKRWGWXXBSIHYLZBPTJQUURJQNDXCTTFCPGTLLHYFVPMPGXADQHXEYOVVMATDDHKOBLDKOADGBBOSSJRMEANELEBVCGRRZPGTDAIZJUQAQYIOROPCMLBOSROFWGNVRBBCZJMQQPMIWQQQNKVLISOKHOEIOVMWKWXONEAPPHLKAXUUESQAKNOEEBMKXOEVOYEROOQNAUUYVBXUILCILFBZXWAWKNXKRNSYHFIIEOLOEFIRHLYOSVCIJMBTWMSZPCCPWBKFAQGDHXPGWWPZNBEBBPHXXARHFCBHYEKAHBBHUHZYJPWPZCCOBHJBJZWQKKDQGOGTDWDJJWTZRNTTAMCICPVONHHKRRHEXKDIIWJZPFAHXMLRYBPJZSWMHAIORVKRURHBXDDAAWDQNJVXGUHKAGUOKGVAGDDQKXKQACAQGIEOBYELNTTQWWMJDBCYRDAERRSWFPKAQKNSBGVVTZIGJGFMPINVUUCIPVJMZJVEARHUFOSFVGYQQDQUURHX

慕斯4360584

GMLBHRVBWTRJEYEDDAAELMBQNAKWQWCSLPEHBXNDGJDDKBXEATQDIOBRGGWSFBOFLEZCSFLUHNBJPNLLFVBFFCJLNMYUTQGGGJPFFBREHMJVFLDFERNDGNNTGNWVTCCSNHUBPXXKKHTXJQMCOQUGDNKAADXMFSSNOLLRANTCKKGXQFLYLNHGTJLYOOBRTSIORBHXKGTEUXHHHLONKMVRRHUDMCIFMSXXKTZUBPVDUQWIQPMBLHIYDTMTNTPHDIFYVEYBYXDDYLPOYUOUXDJBROUAK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