Cod sursă (job #93587)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Bart (clasele 9-10) | Compilator | cpp | 0,44 kb |
Rundă | Tema 8 clasele 9-10 2014/15 | Status | evaluat |
Dată | 29 nov. 2014 23:05:26 | Scor | 80 |
#include <fstream>
using namespace std;
char v[500002] ;
int main()
{
ifstream f("bart.in");
ofstream g("bart.out");
int l = 0 ;
int i , j ;
f>>v+1;
for ( i = 1 , j = 0 ; v[i] != NULL ; i++ , j++ )
{
if ( v[i] != v[j] )
{
l = i ;
j = 0 ;
}
if ( j == l ) j = 0 ;
}
for ( int i = 1 ; i <= l ; i++ )
g<<v[i];
return 0 ;
}