Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118708 唐安轩 寻找绝对素数 C++ Compile Error 0 MS 0 KB 525 2025-05-10 10:57:35

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int FanXuShu(int a){ int b=0; b=b*10+a%10; a=a/10; } return b; } bool su(int x){ for(int i=2;i<=sqrt(x);i++){ if(x%i==0){ return 0; } } return 1; } int main(){ int m,n,k; int f=0; cin>>m>>n; for(int i=m;i<=n;i++){ k=FanXuShu(i); if(su(i)&&su(k)){ if(f==0){ cout<<i; f++; }else{ cout<<","<<i; } } } if(f==0){ cout<<"No"; } return 0; }


Run Info:

Main.cc: In function 'int FanXuShu(int)':
Main.cc:31:2: warning: no return statement in function returning non-void [-Wreturn-type]
  }
  ^
Main.cc: At global scope:
Main.cc:32:2: error: expected unqualified-id before 'return'
  return b;
  ^
Main.cc:33:1: error: expected declaration before '}' token
 }
 ^