Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139517 唐诗阳 判断素数II C++ Compile Error 0 MS 0 KB 569 2025-12-07 14:51:46

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 zhi(int a){ int s=0; for(int i=2;i<a;i++){ if(a%i==0){ s=0; } else{ s=1 } } return s; } int main(){ int n,sum=0; cin>>n; for(int i=2;i<=n;i++){ if(zhi(i)==0) sum++; } cout<<sum; return 0; }


Run Info:

Main.cc: In function 'int zhi(int)':
Main.cc:15:9: error: expected ';' before '}' token
         }
         ^