Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119957 冯俊淞 12奇数和与偶数和 C++ Compile Error 0 MS 0 KB 479 2025-05-22 19:45:28

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int n,i,m,sj=0,so=0; cin>>n>>m; for(i=n;i<=m;i++) { if(i%2==0) so+=i; else sj+=i; } cout<<so<<" "<<sj; int n,i,m,sj=0,so=0; cin>>n>>m; for(i=n;i<=m;i++) { if(i%2==0) so+=i; else sj+=i; } cout<<so<<" "<<sj; return 0;


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:32: error: redeclaration of 'int n'
       cout<