adicionei comentarios
This commit is contained in:
30
src/main/java/com/mycompany/whiles/Whiles.java
Normal file
30
src/main/java/com/mycompany/whiles/Whiles.java
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
|
||||
package com.mycompany.whiles;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 250419
|
||||
*/
|
||||
public class Whiles {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner (System.in);
|
||||
|
||||
System.out.println("introduza um numero positivo");
|
||||
|
||||
int numero = scanner.nextInt();
|
||||
|
||||
while ( numero < 0){
|
||||
|
||||
System.out.println("introduza um numero positivo");
|
||||
|
||||
numero=scanner.nextInt();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user