Advertisement
MUstar

IoT C언어 0710 - EX12_2

Jul 15th, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5. {
  6.     char  word[100], s_word[80];
  7.     while(1)
  8.     {
  9.         printf("단어 입력 : ");
  10.         scanf("%s",s_word);         //단어 입력
  11.         if(strcmp(s_word,"end")==0) break;  //end가 입력되면 while에 나와종료
  12.         strcat(word,s_word);            //s_word값을 word에 이어붙침.
  13.         printf("현재까지의 문자열 : %s\n",word); //출력
  14.         strcat(word," ");           //뛰어쓰기
  15.     }
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement