Task: | Osajono |
Sender: | BigKappa |
Submission time: | 2015-10-02 10:46:15 +0300 |
Language: | C++ |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:10:18: error: cannot convert 'std::string {aka std::basic_string<char>}' to 'const char*' for argument '1' to 'size_t strlen(const char*)' int n = strlen(m); ^ input/code.cpp:19:2: error: expected '}' at end of input } ^
Code
#include <iostream> #include <string> #include <string.h> using namespace std; int main() { string m; cin >> m; int n = strlen(m); int o = n; for (int l = 1; l <= n; l++){ for( int i = 0; i <= n-l;i++){ if(m[i] == m[i+l]){ o++; } } return o; }