Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100176 余彦铮 100至200之间的所有素数 C++ Compile Error 0 MS 0 KB 508 2024-12-06 17:57:39

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 main(){ int a b c; c=0; for(a=100;a<=200;a++){ for(b=2;b<a;b++){ if(a%b==0){ c=c+1; } if(c==0){ cout<<a<<"是素数"; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:8: error: expected initializer before 'b'
  int a b c;
        ^
Main.cc:9:5: error: 'c' was not declared in this scope
     c=0;
     ^
Main.cc:10:9: error: 'a' was not declared in this scope
     for(a=100;a<=200;a++){
         ^
Main.cc:11:13: error: 'b' was not declared in this scope
         for(b=2;b