Adicionado formatação
parent
cafc0530a5
commit
8d81489867
|
|
@ -1,7 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.mycompany.whiletest;
|
package com.mycompany.whiletest;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
@ -15,21 +14,15 @@ public class WhileTest {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Scanner scanner = new Scanner(System.in);
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
|
||||||
System.out.println("Introduza um número positivo");
|
System.out.println("Introduza um número positivo");
|
||||||
|
|
||||||
int numero = scanner.nextInt();
|
int numero = scanner.nextInt();
|
||||||
|
|
||||||
while(numero > 0){
|
while (numero > 0) {
|
||||||
|
|
||||||
System.out.println("Introduza um número positivo");
|
System.out.println("Introduza um número positivo");
|
||||||
|
|
||||||
numero = scanner.nextInt();
|
numero = scanner.nextInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue