Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112068 何松羽 素数判断 C++ Accepted 1 MS 268 KB 292 2025-03-08 12:56:54

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a = 1; for (int i = 2; i <= n - 1; i++) { if (n % i == 0) { a = 0; break; } } if (a == 0) { cout << "not prime" << endl; } else { cout << "prime" << endl; } return 0; }