Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:8:1: error: 's' was not declared in this scope
    8 | s = a + b;
      | ^
/in/foo.cc:11:1: error: 'c' was not declared in this scope
   11 | c = a + b;
      | ^
/in/foo.cc:16:5: error: 'c' was not declared in this scope
   16 | if (c >= m)
      |     ^
/in/foo.cc:19:1: error: break statement not within loop or switch
   19 | break;
      | ^~~~~
/in/foo.cc:6:13: warning: unused variable 'c\U0000ff0cs' [-Wunused-variable]
    6 | int a,b,n,m,c,s;
      |             ^~~~
/in/foo.cc: At global scope:
/in/foo.cc:22:1: error: expected unqualified-id before 'if'
   22 | if (n == 1)
      | ^~
/in/foo.cc:26:1: error: expected unqualified-id before 'if'
   26 | if (n == 2)
      | ^~
/in/foo.cc:30:1: error: 'cout' does not name a type
   30 | cout << s;
      | ^~~~
/in/foo.cc:31:1: error: expected unqualified-id before 'return'
   31 | return 0;
      | ^~~~~~
/in/foo.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^

信息

递交者
类型
递交
题目
P2556 小杨做题2级1 2023.12
语言
C++
递交时间
2025-05-24 19:58:19
评测时间
2025-05-24 19:58:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes