commit inicial exercicio dificil

master
250420 2025-11-18 11:40:02 +00:00
commit be3d842bca
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
*/
package com.mycompany.mavenprojectfor4exercicios;
import java.util.Scanner;
/**
*
* @author 250420
*/
public class MavenprojectFor4Exercicios {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
for (int i = 2; i <= 1000; i++){
boolean primo = true;
for (int j = 2; j < i ; j++){
if(i % j == 0){
primo = false;
break;
}
}
if(primo){
System.out.println(i);
}
}
}
}