Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117969 郝王骏程 判断素数II C++ Compile Error 0 MS 0 KB 510 2025-04-21 19:55:49

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int d(int a); if(x==1)return 0; for(int i=2;i*i<=x;i++){ if(x%i==0) return 0; } int main(){ int n,s; cin>>n; for(int i;i*i<=x;i++){ if(d(x)){ s++ } } cout<<s; return 0; }


Run Info:

Main.cc:6:1: error: stray '\357' in program
 using namespace std;
 ^
Main.cc:6:1: error: stray '\274' in program
Main.cc:6:1: error: stray '\233' in program
Main.cc:11:8: error: stray '\357' in program
        return 0;
        ^
Main.cc:11:8: error: stray '\274' in program
Main.cc:11:8: error: stray '\233' in program
Main.cc:7:1: error: expected ';' before 'int'
 int d(int a);
 ^
Main.cc:8:4: error: expected unqualified-id before 'if'
    if(x==1)return 0;
    ^
Main.cc:9:4: error: expected unqualified-id before 'for'
    for(int i=2;i*i<=x;i++){
    ^
Main.cc:9:16: error: 'i' does not name a type
    for(int i=2;i*i<=x;i++){
                ^
Main.cc:9:23: error: 'i' does not name a type
    for(int i=2;i*i<=x;i++){
                       ^
Main.cc: In function 'int main()':
Main.cc:17:20: error: 'x' was not declared in this scope
     for(int i;i*i<=x;i++){
                    ^
Main.cc:20:9: error: expected ';' before '}' token
         }
         ^