#include %26lt;stdlib.h%26gt;
main( int argc, char **argv )
{
char *s1 = argv[1];
char *s2 = argv[2];
int i;
char *cp;
int count[256];
memset( count, 0, sizeof( count ) );
for( cp = s1; *cp; cp++ )
count[*cp]++;
for( cp = s2; *cp; cp++ )
count[*cp]++;
printf( "unique characters in s1: " );
for( cp = s1; *cp; cp++ )
if( count[*cp] == 1 )
printf( "%c", *cp );
printf( "\nunique characters in s2: " );
for( cp = s2; *cp; cp++ )
if( count[*cp] == 1 )
printf( "%c", *cp );
printf( "\n" );
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment