文章

13

粉丝

328

获赞

13

访问

139.0k

头像
终于100%,tfl
P1011 贵州大学机试题
发布于2020年3月10日 14:41
阅读数 11.6k

#include<stdio.h>
int main(){
	int m[]={0,30,31,30,31,31,30,31,30},mon,day,week,i,sum=0;
	char Eweek[][10]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};//字符数组真的忘完了
	scanf("%d",&mon);
	scanf("%d",&day);
	for(i=5;i<=mon;i++)
	    sum+=m[i-4];
	week=(sum+day-12+4)%7;
	printf("%s",Eweek[week]);
    return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发