Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122589 谭思宸 函数求和 C++ Compile Error 0 MS 0 KB 175 2025-06-21 11:26:02

Tests(0/0):


Code:

#include<iostream> using namespace std; int sum(int n,int m) { return n+m } int main() { for(int i=n;i<=m;i++) { sum=i } return 0; }


Run Info:

Main.cc: In function 'int sum(int, int)':
Main.cc:6:1: error: expected ';' before '}' token
 }
 ^
Main.cc: In function 'int main()':
Main.cc:9:15: error: 'n' was not declared in this scope
     for(int i=n;i<=m;i++)
               ^
Main.cc:9:20: error: 'm' was not declared in this scope
     for(int i=n;i<=m;i++)
                    ^
Main.cc:11:12: error: assignment of function 'int sum(int, int)'
         sum=i
            ^
Main.cc:11:12: error: cannot convert 'int' to 'int(int, int)' in assignment