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