我写了个星座查询器,错在哪里?
我写了个星座查询器,但是如果打上某个日期(比如10月10日)就会出错,为什么?#include <stdio.h>
void main()
{
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char p[12][20]={"摩羯座","水瓶座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座"};
int mo=0;
int day=0;
printf ("星座查询小工具\n");
printf ("请输入您的出生月份\n");
scanf ("%d",&mo);
printf ("请输入您的出生天数\n");
scanf ("%d",&day);
int count;
count=mo*month[mo]+day;
int st=0;
st=(int)((count-20)/30);
printf ("您的星座是");
printf ("%s",p[st]);
}