记录详情

Compile Error

/in/foo.cc:4:1: error: expected identifier before 'struct'
 struct Poly
 ^~~~~~
/in/foo.cc:4:1: error: expected ';' before 'struct'
/in/foo.cc:9:9: error: 'ostream' does not name a type
  friend ostream& operator<<(ostream& out, Poly& p)
         ^~~~~~~
/in/foo.cc: In constructor 'PolyList::PolyList(char*)':
/in/foo.cc:21:3: error: 'ifstream' was not declared in this scope
   ifstream fin(fname);
   ^~~~~~~~
/in/foo.cc:21:3: note: suggested alternative:
In file included from /usr/include/c++/6/ios:38:0,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/iosfwd:162:34: note:   'std::ifstream'
   typedef basic_ifstream<char>   ifstream;
                                  ^~~~~~~~
/in/foo.cc:22:10: error: 'fin' was not declared in this scope
   int n; fin >> n;
          ^~~
/in/foo.cc: In member function 'void PolyList::Add(PolyList)':
/in/foo.cc:80:14: error: 'L' was not declared in this scope
   for(Poly*p=L.Head; p!=NULL;p=p->next)
              ^
/in/foo.cc:83:29: warning: statement has no effect [-Wunused-value]
    newp->coef=p->coef;newp->index;
                       ~~~~~~^~~~~
/in/foo.cc: In member function 'void PolyList::Output()':
/in/foo.cc:90:4: error: 'cout' was not declared in this scope
    cout << *p;
    ^~~~
/in/foo.cc:90:4: 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
                  ^~~~
/in/foo.cc:91:3: error: 'cout' was not declared in this scope
   cout << endl;
   ^~~~
/in/foo.cc:91:3: 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
                  ^~~~
/in/foo.cc:91:11: error: 'endl' was not declared in this scope
   cout << endl;
           ^~~~
/in/foo.cc:91:11: 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: In function 'int main()':
/in/foo.cc:98:5: error: request for member 'Add' in 'L1', which is of non-class type 'PolyList()'
  L1.Add(L2);
     ^~~

信息

递交者
类型
自测
题目
DS1-1 一元多项式的运算
语言
C++
递交时间
2021-12-26 15:15:34
评测时间
2021-12-26 15:15:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes