Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Why WA?

Posted by betaver at 2006-10-22 00:08:42 on Problem 3047
Why I'm WA? And I don't konw if it is only 1 test case?

//PKKU3047 Bovine Birthday
#include <stdio.h>
#include <stdlib.h>

int y,m,d,w,c;
char *weekday[]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};

int main()
{
    scanf("%d%d%d",&y,&m,&d);
    if (m>=3) m-=2;
    else if (m==1) m=11,y--;
    else m==12,y--;
    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]);
    system("pause");
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator