4 条题解
-
0
/* 思路: 思路一:1. 判断是否是质数 */ #include <bits/stdc++.h> using namespace std; int function_find(int n) { if ( n == 1 ) { cout << 1 << endl; return 1; } for ( int i = 2; i <= sqrt(n)+1; i++ )//循环判断是否是质数 (1 >> 根号n) if ( n % i == 0 ) { cout << (n/i) << endl; return 1; } cout << "YES" << endl; return 1; } int main() { int n; cin >> n; function_find(n); return 0; }
信息
- ID
- 98
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- 递交数
- 384
- 已通过
- 109
- 上传者