/in/foo.c:1:1: error: unknown type name 'nt'; did you mean 'int'?
1 | nt main() {
| ^~
| int
/in/foo.c: In function 'main':
/in/foo.c:3:9: error: expected expression before ':' token
3 | std::cout << "请输入整数 n 和要统计的数字 x:" << std::endl;
| ^
/in/foo.c:4:5: error: duplicate label 'std'
4 | std::cin >> n >> x;
| ^~~
/in/foo.c:3:5: note: previous definition of 'std' was here
3 | std::cout << "请输入整数 n 和要统计的数字 x:" << std::endl;
| ^~~
/in/foo.c:4:9: error: expected expression before ':' token
4 | std::cin >> n >> x;
| ^
/in/foo.c:7:9: error: duplicate label 'std'
7 | std::string str = std::to_string(i);
| ^~~
/in/foo.c:3:5: note: previous definition of 'std' was here
3 | std::cout << "请输入整数 n 和要统计的数字 x:" << std::endl;
| ^~~
/in/foo.c:7:13: error: expected expression before ':' token
7 | std::string str = std::to_string(i);
| ^
/in/foo.c:8:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
8 | for (char c : str) {
| ^
/in/foo.c:9:17: error: 'c' undeclared (first use in this function)
9 | if (c - '0' == x) {
| ^
/in/foo.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:15:5: error: duplicate label 'std'
15 | std::cout << "数字 " << x << " 出现的次数为: " << num << std::endl;
| ^~~
/in/foo.c:3:5: note: previous definition of 'std' was here
3 | std::cout << "请输入整数 n 和要统计的数字 x:" << std::endl;
| ^~~
/in/foo.c:15:9: error: expected expression before ':' token
15 | std::cout << "数字 " << x << " 出现的次数为: " << num << std::endl;
| ^
/in/foo.c:3:5: warning: label 'std' defined but not used [-Wunused-label]
3 | std::cout << "请输入整数 n 和要统计的数字 x:" << std::endl;
| ^~~