mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1771.c
This commit is contained in:
parent
796fd2fa8b
commit
82da67cf3a
43
QUSTOJ/1771.c
Normal file
43
QUSTOJ/1771.c
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
scanf("%d",&t);
|
||||
while(t--)
|
||||
{
|
||||
int Y,M,D;
|
||||
scanf("%d %d %d",&Y,&M,&D);
|
||||
struct tm k;
|
||||
memset(&k,0,sizeof(k));
|
||||
k.tm_year=Y-1900;
|
||||
k.tm_mon=M-1;
|
||||
k.tm_mday=D;
|
||||
k.tm_hour=0;
|
||||
k.tm_min=0;
|
||||
k.tm_sec=0;
|
||||
struct tm s;
|
||||
memset(&s,0,sizeof(s));
|
||||
s.tm_year=1990-1900;
|
||||
s.tm_mon=1-1;
|
||||
s.tm_mday=1;
|
||||
s.tm_hour=0;
|
||||
s.tm_min=0;
|
||||
s.tm_sec=0;
|
||||
time_t a=mktime(&k);
|
||||
time_t b=mktime(&s);
|
||||
int day=(a-b)/(3600*24);
|
||||
if(day%5<3)
|
||||
{
|
||||
printf("1\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("0\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user