记录详情

Compile Error

foo.cc: In constructor ‘Complex::Complex(int, int)’:
foo.cc:6:70: error: expected ‘;’ before ‘}’ token
    6 |           Complex(int r, int i){this->r = r; this->i = i; mod=r*r+i*i};
      |                                                                      ^
foo.cc: In function ‘void output(Complex&)’:
foo.cc:25:25: error: unable to find numeric literal operator ‘operator"")’
   25 |         else if (c.i == 0){cout << c.r << endl;}
      |                         ^~~
foo.cc:25:25: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes
foo.cc:25:28: error: expected ‘)’ before ‘{’ token
   25 |         else if (c.i == 0){cout << c.r << endl;}
      |                 ~          ^
      |                            )
foo.cc:28:1: error: expected primary-expression before ‘}’ token
   28 | }
      | ^
foo.cc: In function ‘int main()’:
foo.cc:45:34: error: expected ‘)’ before ‘)’
   45 |         for (int i = 0; i < n;i++){
      |             ~                    ^~
      |                                  )
foo.cc:45:34: error: ‘)’ was not declared in this scope
   45 |         for (int i = 0; i < n;i++){
      |                                  ^~
foo.cc:51:35: error: expected ‘)’ before ‘)’
   51 |         for (int i = 0; i < 3; i++){
      |             ~                     ^~
      |                                   )
foo.cc:51:35: error: ‘)’ was not declared in this scope
   51 |         for (int i = 0; i < 3; i++){
      |                                   ^~
foo.cc:43:17: warning: unused variable ‘com’ [-Wunused-variable]
   43 |         Complex com[3] = {c1,c2,c3};
      |                 ^~~

信息

递交者
类型
递交
题目
P1013 OO2-3 复数数组类的冒泡排序
比赛
2024春 面向对象的程序设计方法(第2场作业赛)
语言
C++
递交时间
2024-04-05 21:17:51
评测时间
2024-04-05 21:17:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes