#include <iostream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <queue>
#include <cstdio>
#include <bitset>
#include <string>
#include <vector>
#include <iomanip>
#include <cstring>
#include <algorithm>
#include <functional>
#include <ctime>
#define PI acos(-1)
#define eps 1e-8
#define inf 0x3f3f3f3f
#define debug(x) cout<<"---"<<x<<"---"<<endl
typedef long long ll;
using namespace std;
int YZ[100000] , yzs;
void DB(int now)
{
yzs = 0;
int maxx = (int)sqrt(now);
for (int i = 1 ; i <= maxx ; i ++)
{
if (now % i == 0)
{
YZ[++yzs] = i;
YZ[++yzs] = now / i;
}
}
if (maxx * maxx == now)
{
yzs --;
}
}
int main()
{
int n;
while (cin >> n)
{
DB(n);
sort(YZ + 1 , YZ + yzs + 1);
for (int i = 1; i <= yzs; i++)
{
cout << YZ[i] << endl;
}
}
return 0;
}
求一个数的因子数打表
最新推荐文章于 2024-05-31 22:44:51 发布