Liberar recursos en condicionales
This commit is contained in:
1 parent
2e8c5cae24
commit
42ccb65310
3 files changed
+7
-2
No files matched your search
@@ -14,11 +14,13 @@ void main() {
|
||||
|
||||
if (!(ano >= 1970 && ano < 3000)) {
|
||||
System.out.println("Fecha inválida");
|
||||
sc.close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(mes > 0 && mes <= 12)){
|
||||
System.out.println("Fecha inválida");
|
||||
sc.close();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,8 +43,9 @@ void main() {
|
||||
|
||||
if (!(dia > 0 && dia <= diasMaximo)) {
|
||||
System.out.println("Fecha inválida");
|
||||
sc.close();
|
||||
return;
|
||||
}
|
||||
System.out.println("Fecha válida");
|
||||
sc.close();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user