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

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; bool s=0; int k; int q; int sushu(int n,int m){ 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)==1&&i!=a){ cout<<","<<i; } else{ cout<<i; } } }


Run Info:

Main.cc: In function 'int sushu(int, int)':
Main.cc:17:7: warning: statement has no effect [-Wunused-value]
      k/10;
       ^
Main.cc: In function 'int main()':
Main.cc:34:13: error: too few arguments to function 'int sushu(int, int)'
   if(sushu(s)==1&&i!=a){
             ^
Main.cc:6:5: note: declared here
 int sushu(int n,int m){
     ^
Main.cc: In function 'int sushu(int, int)':
Main.cc:29:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^