参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); for(int i = n; i <= m; i++) judgePrint(i); } public static void judgePrint(int x) { int i = 2; System.out.print(x + "="); while(x > i) { if(x % i == 0) { System.out.print(i + "*"); x /= i; } else i++; } System.out.println(i); } }
0.0分
5 人评分
printf基础练习2 (C语言代码)浏览:943 |
简单的a+b (C语言代码)浏览:340 |
C语言训练-大、小写问题 (C语言代码)浏览:614 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:1195 |
The 3n + 1 problem (C语言代码)浏览:554 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:560 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:811 |
蛇行矩阵 (C语言代码)浏览:507 |
川哥的吩咐 (C语言代码)浏览:611 |
企业奖金发放 (C语言代码)浏览:2325 |