주의점
문자열 s1과 s2가 있다고 치자
- s1은 전부 출력한다고 생각
- s1에서 겹치는 문자 : 출력 x
- s2는 일부만 출력
- s1에서 겹치는 문자 : 출력 x (while문)
- s2에서 겹치는 문자 : 출력 x (for문)
문제
Assignment name : union
Expected files : union.c
Allowed functions: write
--------------------------------------------------------------------------------
Write a program that takes two strings and displays, without doubles, the
characters that appear in either one of the strings.
The display will be in the order characters appear in the command line, and
will be followed by a \n.
If the number of arguments is not 2, the program displays \n.
Example:
$>./union zpadinton "paqefwtdjetyiytjneytjoeyjnejeyj" | cat -e
zpadintoqefwjy$
$>./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e
df6vewg4thras$
$>./union "rien" "cette phrase ne cache rien" | cat -e
rienct phas$
$>./union | cat -e
$
$>
$>./union "rien" | cat -e
$
$>