Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132695 蔡胤泽 判断素数 C++ Accepted 48 MS 268 KB 346 2025-10-12 10:37:23

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int m; int a = 0;//标记 0 :素数 ,1 : 不是素数 cin >> m; int n = m - 1; while(n > 1) { if(m % n == 0) { a = 1; break; } n--; } if(a == 1) { cout << "not prime"; } else { cout << "prime"; } return 0; }