임에딘

implement exit function

Showing 1 changed file with 17 additions and 4 deletions
1 #include <stdio.h> 1 #include <stdio.h>
2 +
3 +void EXit()
4 +{
5 + exit(1);
6 +}
7 +
2 int main() { 8 int main() {
3 - char Name[20]; 9 + char input[100];
4 - printf("당신의 이름을 입력하세요: "); 10 +
5 - gets(Name); 11 + while(1)
6 - puts(Name); 12 + {
13 + gets(input);
14 + puts(input);
15 +
16 + if (input=="exit")
17 + EXit();
18 + }
7 19
20 + printf("\n");
8 return 0; 21 return 0;
9 } 22 }
...\ No newline at end of file ...\ No newline at end of file
......