광게에 누가 올려놨길래.. 슬금슬금 코딩해본것...
Code Type : C
#include < stdio.h>
#include < string.h>
int main(void)
{
   char a[80];
   char b[5] = "stop";
   int i;
   fgets(a, 79, stdin);
   for(i = 0; i < strstr(a, b) - a; i++)
    {
        printf("%c", a[i]);
    }
}
stop이라는 단어가 들어오지 않을경우..에는 for문이 돌지 않기 때문에 관련이 없지 않을까?
그래도... 혹시나 싶어...
Code Type : C
#include < stdio.h>
#include < string.h>
int main(void)
{
   char a[80];
   char b[5] = "stop";
   int i, j;
   fgets(a, 79, stdin);
   j = strstr(a, b);
   if (j)
   {
      for (i = 0; i < j - a; i++)
      {
        printf("%c", a[i]);
      }
   }
   else
   {
      printf("stop이라는 단어가 없습니다.\n");
   }
   return 0;
}
그냥 심심해서 해본 코딩 -.ㅡ;