题解 | #约数的个数#
约数的个数
https://www.nowcoder.com/practice/04c8a5ea209d41798d23b59f053fa4d6
#include <iostream>
#include "cmath"
using namespace std;
int main() {
int n;
while (cin >> n) { // 注意 while 处理多个 case
// cout << a + b << endl;
while (n--) {
int a;
cin >> a;
int bound = sqrt(a);
int count = 0;
for (int i = 1; i <= bound; i++) {
if (a % i == 0) count += 2;
}
if (a == 1) count=1;
else if (bound * bound == a) {
count--;
}
cout<<count<<endl;
}
}
}
// 64 位输出请用 printf("%lld")


