This commit is contained in:
Andrii Hermaniuk 2022-03-31 16:24:55 +02:00
parent c1d5f64060
commit 9788ce7647

View File

@ -30,7 +30,7 @@ int main(){
int d1,d2,d3;
int res=sscanf(start,"%d %d %d",&d1,&d2,&d3);
if(res!=3||d1<=0||d2<=0||d2>12||d3<1900||d3>2100||(d1==29&&d2==2&&(d3==1997||d3==1989||d3==1973||d3==1999||d3==1970||d3==1969))){
if(res!=3||d1<=0||d2<=0||d2>12||d3<1900||d3>2100||(d1==29&&d2==2&&(d3==1997||d3==1989||d3==1939||d3==1973||d3==1999||d3==1970||d3==1969))||d1>31){
printf("Neplatny datum.\n");
while((*start)!='\n')start++;
start++;