comite inicial
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.mycompany.exerciciosrepeticao4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author 250419
|
||||||
|
*/
|
||||||
|
public class Exerciciosrepeticao4 {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param args
|
||||||
|
*/
|
||||||
|
public static void main(String[]args) {
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user