11D日期巧算星座

    xiaoxiao2021-12-12  2

    

    #include <stdio.h> void constellation(int year,int month,int day); int main() {     int year,month,day;     scanf("%d %d %d",&year,&month,&day);     constellation(year,month,day);     return 0; }

    void constellation(int year,int month,int day) {     switch(month)     {     case 1:         if(day>=20)             printf("水瓶座");         else             printf("摩羯座");         break;     case 2:         if(day>=19)             printf("双鱼座");         else             printf("水瓶座");         break;     case 3:         if(day>=21)             printf("白羊座");         else             printf("双鱼座");         break;     case 4:         if(day>=20)             printf("金牛座");         else             printf("白羊座");         break;     case 5:         if(day>=21)             printf("双子座");         else             printf("金牛座");         break;     case 6:         if(day>=22)             printf("巨蟹座");         else             printf("双子座");         break;     case 7:         if(day>=23)             printf("狮子座");         else             printf("巨蟹座");         break;     case 8:         if(day>=23)             printf("处女座");         else             printf("狮子座");         break;     case 9:         if(day>=23)             printf("天秤座");         else             printf("处女座");         break;     case 10:         if(day>=24)             printf("天蝎座");         else             printf("天秤座");         break;     case 11:         if(day>=23)             printf("射手座");         else             printf("天蝎座");         break;     case 12:         if(day>=21)             printf("摩羯座");         else             printf("射手座");         break;     } }

    转载请注明原文地址: https://ju.6miu.com/read-900128.html

    最新回复(0)