记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:5:2: error: 'cin' was not declared in this scope
  cin>>x;
  ^~~
foo.cc:5:2: note: suggested alternative:
In file included from foo.cc:1:0:
/usr/include/c++/7/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^~~
foo.cc:6:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(x=123)
     ~^~~~
foo.cc:7:3: error: 'cout' was not declared in this scope
   cout<<"321 - 123 = 198"<<endl;
   ^~~~
foo.cc:7:3: note: suggested alternative:
In file included from foo.cc:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
foo.cc:7:28: error: 'endl' was not declared in this scope
   cout<<"321 - 123 = 198"<<endl;
                            ^~~~
foo.cc:7:28: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from foo.cc:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
foo.cc:6:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(x=123)
  ^~
foo.cc:8:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   cout<<"981 - 189 = 792"<<endl;
   ^~~~
foo.cc:8:3: error: 'cout' was not declared in this scope
foo.cc:8:3: note: suggested alternative:
In file included from foo.cc:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
foo.cc:8:28: error: 'endl' was not declared in this scope
   cout<<"981 - 189 = 792"<<endl;
                            ^~~~
foo.cc:8:28: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from foo.cc:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
foo.cc:12:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(x=222)
     ~^~~~

信息

递交者
类型
递交
题目
P1193 黑洞数
比赛
2020苏青奥赛集训营(2021-2-3课堂小练)
语言
C++
递交时间
2021-02-03 13:59:17
评测时间
2021-02-03 13:59:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes