Aktualizovat „du3/program.c“
This commit is contained in:
parent
df9811c3e9
commit
701a9fb030
@ -6,20 +6,20 @@ int main(){
|
||||
int year;
|
||||
scanf("%d.%d.%d", &day, &month, &year);
|
||||
if(day < 1 || day > 31 || month < 1 || month > 12){
|
||||
puts("Neplatny datum");
|
||||
puts("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
if(month == 2 && day > 29){
|
||||
puts("Neplatny datum");
|
||||
puts("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
if(year % 4 != 0 && month == 2 && day > 28){
|
||||
puts("Neplatny datum");
|
||||
puts("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
if(month == 4 || month == 6 || month == 9 || month == 11){
|
||||
if(day > 30){
|
||||
puts("Neplatny datum");
|
||||
puts("Nespravny datum");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user