| ||||||||||
| 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 | |||||||||
不会蔡勒公式的可看这里,Example#include <stdio.h>
int main ()
{
int w, c, y, m, d, a;
scanf("%d %d %d", &a, &m, &d);
if (m == 1 || m == 2) m += 12, a--;
c = a / 100;
y = a % 100;
w = y + (int)(y / 4) + (int)(c / 4) - 2 * c + (int)(26 * (m + 1) / 10) + d - 1;
w = (70000 + w) % 7;
switch (w)
{
case 0: printf("sunday\n"); break;
case 1: printf("monday\n"); break;
case 2: printf("tuesday\n"); break;
case 3: printf("wednesday\n"); break;
case 4: printf("thursday\n"); break;
case 5: printf("friday\n"); break;
case 6: printf("saturday\n"); break;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator