Pentru această operație este nevoie să te autentifici.
Cod sursă (job #257833)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Bart (clasele 9-10) | Compilator | cpp | 0,56 kb |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 27 nov. 2016 13:13:44 | Scor | 20 |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream in("bart.in");
ofstream out("bart.out");
int main()
{
int n,i,j1,j2;
char s[500001];
char test1[250001];
char test2[250001];
in.getline(s,500001);
n=strlen(s);
for(i=1; i<=n; i++)
{
for(j1=0; j1<i; j1++)
test1[j1]=s[j1];
for(j2=i; j2<2*i; j2++)
test2[j2-i]=s[j2];
if(strcmp(test1,test2)==0)
{
out<<test1;
break;
}
}
return 0;
}