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 |
W取模后可能是负数啊,这个你没处理。In Reply To:Still WA Posted by:betaver at 2006-10-22 12:23:44 > //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