第二十周-日期妙算星座

#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");
    }
感觉不是很妙啊。。。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值