fork download
  1. int n;
  2. char is_prime[MAXN];
  3. memset(is_prime,1,n*sizeof(char));
  4. is_prime[0] = 0;
  5. is_prime[1] = 0;
  6. for (int i=2; i * i<=n; i++)
  7. if (is_prime[i])
  8. if (i * 1ll * i <= n)
  9. for (int j=i*i; j<=n; j += i)
  10. is_prime[j] = 0;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2: error: ‘MAXN’ was not declared in this scope
prog.cpp:3: error: expected constructor, destructor, or type conversion before ‘(’ token
prog.cpp:4: error: expected constructor, destructor, or type conversion before ‘=’ token
prog.cpp:5: error: expected constructor, destructor, or type conversion before ‘=’ token
prog.cpp:6: error: expected unqualified-id before ‘for’
prog.cpp:6: error: expected constructor, destructor, or type conversion before ‘*’ token
prog.cpp:6: error: expected constructor, destructor, or type conversion before ‘++’ token
prog.cpp:9: error: expected constructor, destructor, or type conversion before ‘<=’ token
prog.cpp:9: error: expected constructor, destructor, or type conversion before ‘+=’ token
stdout
Standard output is empty