commit 8dbe123df7705301fd839d5fa4df55675e9b20db Author: 250416 <250416@localhost> Date: Tue Nov 11 11:30:38 2025 +0000 Commit inicial diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4d25afa --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + mavenproject14 + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.mavenproject14.Mavenproject14 + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/mavenproject14/Mavenproject14.java b/src/main/java/com/mycompany/mavenproject14/Mavenproject14.java new file mode 100644 index 0000000..b134b04 --- /dev/null +++ b/src/main/java/com/mycompany/mavenproject14/Mavenproject14.java @@ -0,0 +1,24 @@ +/* + * 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(); + + } + } +}