1 条题解
-
0
C++ :
#include<iostream> #include<cmath> using namespace std; bool isprime(int n) //判断是否素数 { int t=sqrt(n); for (int i=2; i<=t; i++) if (n%i==0) return false; return true; } int main() { int n; cin>>n; if (isprime(n)) cout<<1<<endl; else cout<<0<<endl; return 0; }
- 1
信息
- ID
- 4179
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者