Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scomposizione;
- /**
- *
- * @author PC16
- */
- public class Scomposizione {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- System.out.println("Grazie a questo programma potrai scomporre un numero in fattori primi");
- System.out.println("Inserisci un valore da scomporre:");
- int i;
- i = Console.leggiInt();
- for (int j = 2; j <= i; i++){
- if (i % j == 0)
- System.out.println(j);
- i = i/j;
- j=1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement