Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Still WAIn Reply To:重写了,还是WA Posted by:betaver at 2006-10-22 12:22:28 //PKKU3047 Bovine Birthday #include <stdio.h> #include <stdlib.h> int y,m,d,w,c,a; char *weekday[]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"}; int main() { while (scanf("%d%d%d",&y,&m,&d)!=EOF){ a=(14-m)/12; y=y-a; m=m+12*a-2; c=y/100; y=y%100; w=(c/4-2*c+y+y/4+((13*m-1)/5)+d)%7; printf("%s\n",weekday[w]); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator