Skip to content

Commit

Permalink
Add regra de valores
Browse files Browse the repository at this point in the history
  • Loading branch information
devJunr committed Oct 24, 2024
1 parent 95dde07 commit 9fc381f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion desafio-03/devjunr/java/palindromicos.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ public static void main(String[] args) {
int valorInicial = Integer.parseInt(args[0]);
int valorFinal = Integer.parseInt(args[1]);
if (valorInicial > 0 & valorFinal > 0) {
System.out.println(
if (valorFinal < valorInicial){
System.out.println("O valor final não pode ser menor que o valor inicial");
}else{
System.out.println(
"_".repeat(15)
+ "\nValor Inicial: "
+ valorInicial
Expand All @@ -13,6 +16,7 @@ public static void main(String[] args) {
+ "\n"
+ "_".repeat(15));
tratamentoDosValores(valorInicial, valorFinal);
}
} else if (valorInicial <= 0 || valorFinal <= 0) {
System.out.println("São aceitos apenas valores positivos");
}
Expand Down

0 comments on commit 9fc381f

Please sign in to comment.