Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
114843 吴诗涵 寻找绝对素数 C++ Compile Error 0 MS 0 KB 735 2025-03-23 18:49:01

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 out(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0){ return 0; } } return 1; } int out_a(int y){ int s=0; while(y!=0){ s=s*10+y%10; y/=10; } return out(s); } int main(){ int m,n,c=0,f=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(out_a(i)&&out(i)){ if(f==0) f++; cout<<i; else cout<<','<<i; f++; } } if(f==0){ cout<<"No"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:30:9: error: expected '}' before 'else'
         else
         ^
Main.cc:23:9: warning: unused variable 'c' [-Wunused-variable]
 int m,n,c=0,f=0;
         ^
Main.cc: At global scope:
Main.cc:35:1: error: expected unqualified-id before 'if'
 if(f==0){
 ^
Main.cc:38:5: error: expected unqualified-id before 'return'
     return 0;
     ^
Main.cc:39:1: error: expected declaration before '}' token
 }
 ^