Pagini recente » Diferente pentru problema/colier intre reviziile 3 si 4 | Cod sursa (job #1002998) | Cod sursa (job #2348545) | Cod sursa (job #41605) | Cod sursa (job #37727)
Cod sursa(job #37727)
#include <fstream.h>
#include <string.h>
ifstream f("elimin2.in");
ofstream g("elimin2.out");
int main ()
{long i,j,n,t,k;
char a[10000],*p;
while (!f.eof())
{f.get(a,1000);
f.get();
t=0;n=strlen(a);
for (i=0;i<strlen(a)/2;i++)
{ j=i;
if (a[j]!=a[strlen(a)-j-1])
{p=&a[j];
strcpy(p,p+1);
t++;i--;}
}
g<<a<<endl;}
return 0;}