Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148248 于墨轩 素数判断 C++ Compile Error 0 MS 0 KB 377 2026-02-10 14:01:09

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; bool s(int x){ if(x<=1) return false; for(int i=2;i*i<=x;i++){ if(x%i==0) return false; } return ture; } int main(){ int n; scanf("%d",&n); if(s(n)){ cout<<"prime"; }else{ cout<<"not prime"; return 0; }


Run Info:

Main.cc: In function 'bool s(int)':
Main.cc:11:18: error: 'ture' was not declared in this scope
           return ture;
                  ^
Main.cc: In function 'int main()':
Main.cc:25:1: error: expected '}' at end of input
 }
 ^
Main.cc:17:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^