记录详情

Compile Error

foo.cc:3:1: error: expected identifier before 'int'
    3 | int main()
      | ^~~
foo.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | int main()
      | ~~~             
foo.cc: In function 'int main()':
foo.cc:7:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |  cin>>x;
      |  ^~~
      |  std::cin
In file included from foo.cc:1:
/usr/include/c++/9/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
foo.cc:10:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   10 |  if(x=1)
      |     ~^~
foo.cc:13:10: error: lvalue required as left operand of assignment
   13 |   if(x%2=0)
      |          ^
foo.cc:14:8: error: lvalue required as left operand of assignment
   14 |    x/2=x;
      |        ^
foo.cc:15:11: error: lvalue required as left operand of assignment
   15 |       n+1=n;
      |           ^
foo.cc:16:2: error: 'else' without a previous 'if'
   16 |  else
      |  ^~~~
foo.cc:17:3: error: unable to find numeric literal operator 'operator""x'
   17 |   3x+1=x;
      |   ^~
foo.cc:17:3: note: use '-fext-numeric-literals' to enable more built-in suffixes
foo.cc:18:7: error: lvalue required as left operand of assignment
   18 |   n+1=n;
      |       ^
foo.cc:20:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |  cout<<n;
      |  ^~~~
      |  std::cout
In file included from foo.cc:1:
/usr/include/c++/9/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
2-1 单个数的3N+1猜想
比赛
2022暑期青少年社团(入门赛)
语言
C++
递交时间
2022-07-28 18:23:08
评测时间
2022-07-28 18:23:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes