记录详情

Compile Error

/in/foo.cc:26:9: error: 'ostream' does not name a type
  friend ostream& operator<<(ostream& out, const BigInt& bi);
         ^~~~~~~
/in/foo.cc:29:9: error: 'istream' does not name a type
  friend istream& operator>>(istream& in, BigInt& bi);
         ^~~~~~~
/in/foo.cc:35:26: error: 'string' does not name a type
  BigInt& operator=(const string& str);
                          ^~~~~~
/in/foo.cc:112:1: error: 'ostream' does not name a type
 ostream& operator<<(ostream& out, const BigInt& bi)
 ^~~~~~~
/in/foo.cc:125:1: error: 'istream' does not name a type
 istream& operator>>(istream& in, BigInt& bi)
 ^~~~~~~
/in/foo.cc:161:33: error: 'string' does not name a type
 BigInt& BigInt::operator=(const string& str)
                                 ^~~~~~
/in/foo.cc: In member function 'BigInt& BigInt::operator=(const int&)':
/in/foo.cc:163:22: error: request for member 'length' in 'str', which is of non-class type 'const int'
  int strLength = str.length();
                      ^~~~~~
/in/foo.cc:171:34: error: invalid types 'const int[int]' for array subscript
   int bit = str[strLength - 1 - i] - '0';
                                  ^
/in/foo.cc: In member function 'BigInt& BigInt::operator*(const BigInt&)':
/in/foo.cc:198:27: error: ambiguous overload for 'operator=' (operand types are 'BigInt' and 'int')
  static BigInt sum; sum = 0;
                           ^
/in/foo.cc:143:9: note: candidate: BigInt& BigInt::operator=(const BigInt&)
 BigInt& BigInt::operator=(const BigInt& bi)
         ^~~~~~
/in/foo.cc:161:9: note: candidate: BigInt& BigInt::operator=(const int&)
 BigInt& BigInt::operator=(const string& str)
         ^~~~~~
/in/foo.cc:182:9: note: candidate: BigInt& BigInt::operator=(int)
 BigInt& BigInt::operator=(const int num)
         ^~~~~~
/in/foo.cc: In member function 'BigInt& BigInt::operator*(int)':
/in/foo.cc:215:3: error: 'cerr' was not declared in this scope
   cerr << "BigInt operator*(int mult_2), invalid parameter: " << mult_2 << endl;
   ^~~~
/in/foo.cc:215:3: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:62:18: note:   'std::cerr'
   extern ostream cerr;  /// Linked to standard error (unbuffered)
                  ^~~~
/in/foo.cc:215:76: error: 'endl' was not declared in this scope
   cerr << "BigInt operator*(int mult_2), invalid parameter: " << mult_2 << endl;
                                                                            ^~~~
/in/foo.cc:215:76: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/foo.cc:220:27: error: ambiguous overload for 'operator=' (operand types are 'BigInt' and 'int')
  static BigInt ans; ans = 0;
                           ^
/in/foo.cc:143:9: note: candidate: BigInt& BigInt::operator=(const BigInt&)
 BigInt& BigInt::operator=(const BigInt& bi)
         ^~~~~~
/in/foo.cc:161:9: note: candidate: BigInt& BigInt::operator=(const int&)
 BigInt& BigInt::operator=(const string& str)
         ^~~~~~
/in/foo.cc:182:9: note: candidate: BigInt& BigInt::operator=(int)
 BigInt& BigInt::operator=(const int num)
         ^~~~~~
/in/foo.cc: In member function 'BigInt& BigInt::operator+(int)':
/in/foo.cc:251:27: error: ambiguous overload for 'operator=' (operand types are 'BigInt' and 'int')
  static BigInt ans; ans = 0;
                           ^
/in/foo.cc:143:9: note: candidate: BigInt& BigInt::operator=(const BigInt&)
 BigInt& BigInt::operator=(const BigInt& bi)
         ^~~~~~
/in/foo.cc:161:9: note: candidate: BigInt& BigInt::operator=(const int&)
 BigInt& BigInt::operator=(const string& str)
         ^~~~~~
/in/foo.cc:182:9: note: candidate: BigInt& BigInt::operator=(int)
 BigInt& BigInt::operator=(const int num)
         ^~~~~~
/in/foo.cc: In member function 'BigInt& BigInt::operator+(const BigInt&)':
/in/foo.cc:276:27: error: ambiguous overload for 'operator=' (operand types are 'BigInt' and 'int')
  static BigInt ans; ans = 0;
                           ^
/in/foo.cc:143:9: note: candidate: BigInt& BigInt::operator=(const BigInt&)
 BigInt& BigInt::operator=(const BigInt& bi)
         ^~~~~~
/in/foo.cc:161:9: note: candidate: BigInt& BigInt::operator=(const int&)
 BigInt& BigInt::operator=(const string& str)
         ^~~~~~
/in/foo.cc:182:9: note: candidate: BigInt& BigInt::operator=(int)
 BigInt& BigInt::operator=(const int num)
         ^~~~~~
/in/foo.cc: In member function 'BigInt& BigInt::operator<<(int)':
/in/foo.cc:304:3: error: 'cerr' was not declared in this scope
   cerr << "BigInt operator<<(int n), parameter: " << n << " is too big." << endl;
   ^~~~
/in/foo.cc:304:3: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:62:18: note:   'std::cerr'
   extern ostream cerr;  /// Linked to standard error (unbuffered)
                  ^~~~
/in/foo.cc:304:77: error: 'endl' was not declared in this scope
   cerr << "BigInt operator<<(int n), parameter: " << n << " is too big." << endl;
                                                                             ^~~~
/in/foo.cc:304:77: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/foo.cc: At global scope:
/in/foo.cc:409:9: error: 'ostream' does not name a type
  friend ostream& operator<<(ostream& out, BigIntArray& obj)
         ^~~~~~~
/in/foo.cc: In function 'int main(int, char**)':
/in/foo.cc:445:9: error: 'cin' was not declared in this scope
  int n; cin >> n;
         ^~~
/in/foo.cc:445:9: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^~~
/in/foo.cc:452:2: error: 'cout' was not declared in this scope
  cout << biArr;
  ^~~~
/in/foo.cc:452:2: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~

信息

递交者
类型
自测
语言
C++
递交时间
2024-05-02 23:20:50
评测时间
2024-05-02 23:20:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes