25 lines
584 B
Java
25 lines
584 B
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
*/
|
|
package com.mycompany.mavenproject14;
|
|
|
|
import java.util.Scanner;
|
|
|
|
/**
|
|
*
|
|
* @author 250416
|
|
*/
|
|
public class Mavenproject14 {
|
|
|
|
public static void main(String[] args) {
|
|
Scanner scanner = new Scanner(System.in);
|
|
System.out.println("Introduza um número positivo");
|
|
int numero = scanner.nextInt();
|
|
while (numero < 0) {
|
|
System.out.println("Introduza um número positivo");
|
|
numero = scanner.nextInt();
|
|
|
|
}
|
|
}
|
|
}
|