Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150765 刘柠锐 13求n加到m的和 C++ Compile Error 0 MS 0 KB 135 2026-03-30 17:22:44

Tests(0/0):


Code:

#include<iostream> using nameaspace std; int maina(){ int m,e; cin>>x>>m; e=0; for(;x<=m;x++){ e=e++x; } cout<<e; }


Run Info:

Main.cc:2:7: error: expected nested-name-specifier before 'nameaspace'
 using nameaspace std; 
       ^
Main.cc: In function 'int maina()':
Main.cc:5:1: error: 'cin' was not declared in this scope
 cin>>x>>m; 
 ^
Main.cc:5:1: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:5:6: error: 'x' was not declared in this scope
 cin>>x>>m; 
      ^
Main.cc:8:7: error: expected ';' before 'x'
  e=e++x; 
       ^
Main.cc:8:8: warning: operation on 'e' may be undefined [-Wsequence-point]
  e=e++x; 
        ^
Main.cc:10:1: error: 'cout' was not declared in this scope
 cout<