diff --git a/du3/program.c b/du3/program.c index d64438b..60be17b 100644 --- a/du3/program.c +++ b/du3/program.c @@ -10,6 +10,10 @@ int day=0; int m=0; int y=0; sscanf(str, "%d.%d.%d", &day, &m, &y); +if(day>28 && m==2 &&(y%400==0 ||(y%100!=0 && y%4==0))){ + printf("Nespravny datum"); + return 0; +} day+=7; if(m%2!=0 && day>31){ day-=31;