Code Submission Evaluation System Login

Datatähti 2016 alku

Start:2015-09-28 00:00:00
End:2015-10-12 00:00:00
 

Tasks | Scoreboard | Statistics


CSES - Datatähti 2016 alku - Results
History
2015-10-03 00:34:31100
2015-10-03 00:29:4239
2015-10-03 00:29:0439
2015-10-02 11:30:5539
2015-10-02 11:29:410
2015-10-02 11:28:250
2015-10-02 10:48:470
2015-10-02 10:47:27
2015-10-02 10:46:15
2015-10-02 10:45:35
2015-10-02 10:41:41
2015-10-02 10:22:2412
2015-10-02 10:19:000
Task:Osajono
Sender:BigKappa
Submission time:2015-10-02 10:45:35
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:18: error: 'strlen' was not declared in this scope
  int n = strlen(m);
                  ^
input/code.cpp:18:2: error: expected '}' at end of input
  }
  ^

Code

#include <iostream>
#include <string>

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;
	}