#include<stdio.h>
#include<stdlib.h>
int main() {
int i,flag,j;
const int N=3;
char on_il[N],dieu[N],*ptr_on,*ptr_dieu,*ptr_il,il[1];
for(i=0; i<N; i++) {
printf("dwse to onomatepvnumo kai thn ilikia tou atomou\n");
gets(on_il);
printf("dwse th dieuthinsh kai ton taxudromiko kwdiko tou atomou\n");
gets(dieu); }
printf("dwse mia ilikia");
gets(il);
ptr_on=on_il;
ptr_il=il;
flag=0;
i=0;
j=0;
while(*ptr_on+i!='\0') {
if(*(*(ptr_on+i)+j)==*ptr_il) {
flag++;
ptr_il++;
j++; }
else
j++; }
if(flag==2) {
printf("%s",*ptr_on+i); }
i++; }
getch();
return 0; }