Aktualizovat „du3/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-26 22:20:22 +00:00
parent c75ad60f3c
commit aacaf91247

View File

@ -6,7 +6,6 @@
int ValidateTime(int dd , int mm , int yy)
{
int res = 0;
if(yy>=1900 && yy<=9999)
{
//check month
@ -14,26 +13,25 @@ int ValidateTime(int dd , int mm , int yy)
{
//check days
if((dd>=1 && dd<=31) && (mm==1 || mm==3 || mm==5 || mm==7 || mm==8 || mm==10 || mm==12))
res = 1;
return 1;
else if((dd>=1 && dd<=30) && (mm==4 || mm==6 || mm==9 || mm==11))
res = 1;
return 1;
else if((dd>=1 && dd<=28) && (mm==2))
res = 1;
return 1;
else if(dd==29 && mm==2 && (yy%400==0 ||(yy%4==0 && yy%100!=0)))
res = 1;
return 1;
else
res = 0;
return 0;
}
else
{
res = 0;
return 0;
}
}
else
{
res = 0;
return 0;
}
retrun res;
}
int main()