Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132696 蔡胤泽 判断素数 C++ Accepted 45 MS 272 KB 350 2025-10-12 10:39:35

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(n != 1) { cout << "not prime"; } else { cout << "prime"; } return 0; }