Изменить 'du3/program.c'
This commit is contained in:
parent
47dbaeb0a3
commit
9a061c8842
@ -10,15 +10,18 @@ int day=0;
|
||||
int m=0;
|
||||
int y=0;
|
||||
sscanf(str, "%d.%d.%d", &day, &m, &y);
|
||||
if(y%400==0 ||(y%100!=0 && y%4==0)){
|
||||
z++;
|
||||
}
|
||||
if(m==2){
|
||||
if((y%400==0 ||(y%100!=0 && y%4==0))&&day>29){
|
||||
if(z==1 &&day>29){
|
||||
printf("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
if(z==0 &&day>28){
|
||||
printf("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
// else if((y%400!=0 ||(y%100==0 && y%4!=0))&&day>28){
|
||||
// printf("Nespravny datum");
|
||||
// return 0;
|
||||
// }
|
||||
}
|
||||
day+=7;
|
||||
if(m%2!=0 && day>31){
|
||||
|
Loading…
Reference in New Issue
Block a user