Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
144571 王润中 12奇数和与偶数和 C++ Compile Error 0 MS 0 KB 249 2026-01-24 10:59:51

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int m=1,n=1000,c=d=0; for(int a=m;a<n;a++) { if(a%2==1) { c=c+a; } else { d=d+a; } } cout<<c<<" "<<d; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:19: error: 'd' was not declared in this scope
  int m=1,n=1000,c=d=0;
                   ^