Problem firstabc
User christal
Submission Time 2023-12-06 09:43:35
Score 0
Max Time N/A
Max Memory N/A

Compile Error

firstabc.cpp: In function ‘int main()’:
firstabc.cpp:14:5: error: expected initializer before ‘int’
14 | int ans = (n * (n + 1)) / 2;
| ^~~
firstabc.cpp:47:12: error: redeclaration of ‘std::string str’
47 | string str = "babac";
| ^~~
firstabc.cpp:5:9: note: ‘std::string str’ previously declared here
5 | string str;
| ^~~
firstabc.cpp:48:9: error: redeclaration of ‘int n’
48 | int n = str.length();
| ^
firstabc.cpp:6:6: note: ‘int n’ previously declared here
6 | int n;
| ^
firstabc.cpp:50:13: error: ‘CountSubstring’ was not declared in this scope
50 | cout << CountSubstring(str, n);
| ^~~~~~~~~~~~~~