记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:5:2: error: 'cin' was not declared in this scope
    5 |  cin<<x;
      |  ^~~
foo.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
foo.cc:5:7: error: 'x' was not declared in this scope
    5 |  cin<<x;
      |       ^
foo.cc:9:4: error: 'cout' was not declared in this scope
    9 |    cout>>x;
      |    ^~~~
foo.cc:9:4: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc:10:4: error: expected '}' before 'else'
   10 |    else
      |    ^~~~
foo.cc:7:13: note: to match this '{'
    7 |   if(x%2==0){
      |             ^
foo.cc:12:4: error: 'cout' was not declared in this scope
   12 |    cout>>x;
      |    ^~~~
foo.cc:12:4: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc: At global scope:
foo.cc:15:11: error: expected constructor, destructor, or type conversion before '(' token
   15 |     printf("hello, world\n");
      |           ^
foo.cc:16:2: error: expected unqualified-id before 'return'
   16 |  return 0;
      |  ^~~~~~
foo.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
2-1 单个数的3N+1猜想
语言
C++
递交时间
2022-07-28 21:26:42
评测时间
2022-07-28 21:26:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes