Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118702 王煜鑫 寻找绝对素数 C++ Compile Error 0 MS 0 KB 448 2025-05-10 10:42:09

Tests(0/0):


Code:

#include <bits/stdc++.h> using namespace std; int fanxushu(int a){ int b=0; while(a!=0){ b=b*10+a%10; a=a/10; } return b; } bool sushu(int n){ if(n==2) return 1; for(int i=2;i<=sqrt(n);i++){ if(n%i==0) return 0; } return 1; int main() { int m,n,k,sum++; cin>>m>>n; for(int i=m;i<=n;i++){ k=b; if(shusu(m)==shush(k)) cout<<m<<","; sum++; } if(sum==0) cout<<"No"; return 0; }


Run Info:

Main.cc: In function 'bool sushu(int)':
Main.cc:17:12: error: a function-definition is not allowed here before '{' token
 int main() {
            ^
Main.cc:27:1: error: expected '}' at end of input
 }
 ^