'commit'
This commit is contained in:
21
TangDou/KaoShi/合数的因子个数.cpp
Normal file
21
TangDou/KaoShi/合数的因子个数.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int n;
|
||||
bool check(int x) {
|
||||
int cnt = 0;
|
||||
for (int i = 1; i <= x; i++)
|
||||
if (x % i == 0) cnt++;
|
||||
return cnt == n;
|
||||
}
|
||||
|
||||
int main() {
|
||||
cin >> n;
|
||||
for (int i = 3; i <= 100; i++) {
|
||||
if (check(i)) {
|
||||
printf("%d", i);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user