Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118698 刘佳宇 寻找绝对素数 C++ Compile Error 0 MS 0 KB 517 2025-05-10 10:31:46

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int k; int q; int sushu(int n,int m,int s){ for(int i=n;i<=m;i++){ for(int j=2;j<i;j++){ k=j; if(i%k==0){ s=0; return s; } else{ while(k>0){ q+=k*10%10; k/10; } for(int i=2;i<k;i++){ if(k%i==0){ s=1; return s; } } } } } } int main(){ int a,b; for(int i=a;i<=b;i++){ if(sushu(s) && i!=a){ cout<<","<<i; } else{ cout<<i; } } }


Run Info:

Main.cc: In function 'int sushu(int, int, int)':
Main.cc:17:7: warning: statement has no effect [-Wunused-value]
      k/10;
       ^
Main.cc: In function 'int main()':
Main.cc:34:12: error: 's' was not declared in this scope
   if(sushu(s) && i!=a){
            ^
Main.cc: In function 'int sushu(int, int, int)':
Main.cc:29:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^