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)提供评测服务