Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154866 刘睿霖 12奇数和与偶数和 C++ Compile Error 0 MS 0 KB 288 2026-05-31 10:58:12

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int m; int n; int j=0; int o=0; cin>>m>>n; for(int i=m;i<=n;++i) { if(i%2==1) j=j+i; }else{ o=o+i } } cout<<o<<" "<<j; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:14:6: error: 'else' without a previous 'if'
     }else{
      ^
Main.cc:15:17: error: 'i' was not declared in this scope
             o=o+i
                 ^
Main.cc: At global scope:
Main.cc:18:5: error: 'cout' does not name a type
     cout<