Compile Error

foo.cc: In function 'int main()':
foo.cc:14:5: error: 'k' was not declared in this scope
   14 |     k++;
      |     ^
foo.cc:17:6: error: 'k' was not declared in this scope
   17 |   if(k==2)
      |      ^
foo.cc:19:20: error: expected ';' before 'count'
   19 |    printf("%-4d",i)
      |                    ^
      |                    ;
   20 |    count++;
      |    ~~~~~            
foo.cc:21:11: error: no match for 'operator%' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   21 |    if(cout%5==0)
      |       ~~~~^~
      |       |    |
      |       |    int
      |       std::ostream {aka std::basic_ostream<char>}
foo.cc:21:11: note: candidate: 'operator%(int, int)' <built-in>
   21 |    if(cout%5==0)
      |       ~~~~^~
foo.cc:21:11: note:   no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
foo.cc:7:6: warning: unused variable 'count' [-Wunused-variable]
    7 |  int count=0;
      |      ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1044 所有的素数
语言
C++
递交时间
2021-12-18 09:04:38
评测时间
2021-12-18 09:04:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes