Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/old/
Upload File :
Current File : /var/www/html/venkat/old/iit2015107_2.c

#include<stdio.h>
#include<string.h>
int main()
{
	int i, j, k;
	char str1[2][100], str2[2][100];
	scanf("%s %s", str1[0], str2[0]);
	for(i=0;str1[0][i]!='\0';i++)
	{
		str1[1][i]='0';
	}
	for (i=0;str2[0][i]!='\0';i++)
	{
		str2[1][i]='0';
	}
	for(i=0;str2[0][i]!='\0';i++)
	{
		for (j=0;str1[0][j]!='\0';j++)
		{
			if(str2[0][i]==str1[0][j] && str1[1][j]=='0')
			{
				printf("%c", str2[0][i]);
				str1[1][j]='1';
				break;
			}
		}
	}
	return 0;
}