标签:exti 整数 list 质因数分解 system next out span else
1 import java.text.DecimalFormat; 2 import java.text.NumberFormat; 3 import java.util.ArrayList; 4 import java.util.Scanner; 5 6 public class Main{ 7 public static void main(String[] args){ 8 Scanner input = new Scanner(System.in); 9 int n,m; 10 n = input.nextInt(); 11 m = input.nextInt(); 12 for(int i=n;i<=m;i++){ 13 int temp = i; 14 int j = 2; 15 boolean flag = true; 16 System.out.print(i+"="); 17 while(temp!=1){ 18 if(temp%j==0){ 19 if(flag){ 20 System.out.print(j); 21 temp = temp/j; 22 flag = false; 23 continue; 24 } 25 System.out.print("*"+j); 26 temp = temp/j; 27 }else{ 28 j++; 29 } 30 } 31 System.out.println(); 32 33 } 34 } 35 }
标签:exti 整数 list 质因数分解 system next out span else
原文地址:http://www.cnblogs.com/lolybj/p/6506436.html