#include <bits/stdc++.h>
using namespace std;
int n;
int Get(int x)
{
int ans = 0;
for(int i = 1;i <= x / i; i ++)
{
if(x % i == 0 && i != x / i) ans += 2;
if(x % i == 0 && i == x / i) ans += 1;
}
return ans;
}
int main()
{
cin >> n;
for(int i = 0;i < n;i ++)
{
int x;
cin >> x;
cout << Get(x) << endl;
}
return 0;
}
蓝桥杯刷题-约数的个数
最新推荐文章于 2024-06-20 19:59:33 发布