#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 y,int m,int d)
{
if((m==12&&d>=21)||(m==1&&d<=19))
printf("摩羯座\n");
if((m==1&&d>=20)||(m==2&&d<=18))
printf("水瓶座\n");
if((m==2&&d>=19)||(m==3&&d<=20))
printf("双鱼座\n");
if((m==3&&d>=21)||(m==4&&d<=19))
printf("白羊座\n");
if((m==4&&d>=20)||(m==5&&d<=20))
printf("金牛座\n");
if((m==5&&d>=21)||(m==6&&d<=21))
printf("双子座\n");
if((m==6&&d>=22)||(m==7&&d<=22))
printf("巨蟹座\n");
if((m==7&&d>=23)||(m==8&&d<=22))
printf("狮子座\n");
if((m==8&&d>=23)||(m==9&&d<=22))
printf("处女座\n");
if((m==9&&d>=23)||(m==10&&d<=23))
printf("天秤座\n");
if((m==10&&d>=24)||(m==11&&d<=22))
printf("天蝎座\n");
if((m==11&&d>=23)||(m==12&&d<=21))
printf("射手座\n");
}
感觉不是很妙啊。。。