Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123011 陈淮遇 12奇数和与偶数和 C++ Compile Error 0 MS 0 KB 177 2025-06-22 13:31:10

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int i; for (int a = 1; a < 21; a++) { if (a % 3 == 0) { s = s + a; } } cout << s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:4: error: 's' was not declared in this scope
    s = s + a;
    ^
Main.cc:10:10: error: 's' was not declared in this scope
  cout << s;
          ^
Main.cc:4:6: warning: unused variable 'i' [-Wunused-variable]
  int i;
      ^