#include <stdio.h> #include <string.h> #define Num 10 int main() { int c,i,j = 0,m,n = 0,count1 = 0,count2 = 0; char s[Num],t[Num],st[Num],str[Num]; printf("Please input a string: "); while((c = getchar()) != EOF && c != ' ' && count1 < Num) { s[count1] = c; count1++; } printf("Please input another string: "); while((c = getchar()) != EOF && c != ' ' && count2 < Num) { t[count2] = c; count2++; } for(i = 0; s[i] != ' ' && i < count1; i++) { if(s[i] != t[i]) { st[j] = s[i]; j++; } } for(i = 0; t[i] != ' ' && i < count2; i++) { if(s[i] != t[i]) { str[n] = t[i]; n++; } } for(m = 0;m < j ;m++ ) { printf("%c",st[m]); } printf(" "); for(m = 0;m < n ;m++ ) { printf("%c",str[m]); } return 0; }