#include<iostream>
#include<cmath>
using namespace std;
int main() {
cout << "请输入一个数" << endl;
int n,i=2,t;
cin >> n;
if (i < n) {
t = n % i;
if (t == 0)
cout << "该数不为素数";
i = i + 1;
}
else
cout << "该数为素数" << endl;
return 0;
}
homework-8
最新推荐文章于 2024-04-01 13:14:47 发布