Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158599 王慕哲 素数判断 C++ Compile Error 0 MS 0 KB 260 2026-08-22 15:29:14

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:25: error: 'n' was not declared in this scope
     for(int i=2;i<=sqrt(n);i++){
                         ^