标签:use name printf bre == system cin div ace
原理有点像埃氏筛。
#include <stdio.h> #include <iostream> #include <stdlib.h> using namespace std; int main() { int n; cin >> n; for (int i = 2; i <= n; i++) { while (n != 1) { if (n % i == 0) { n /= i; printf("%d\n", i); } else break; } } system("pause"); }
标签:use name printf bre == system cin div ace
原文地址:https://www.cnblogs.com/woxiaosade/p/9966805.html