#include <stdio.h>


int main()

{

 int i,max;

 while (1) {

   scanf("%d",&i);

   max = 0;

   while(getchar() != 10) max++;

   if(max == 0 && 1 <= i && i <= 100)

     printf("정상적인 (1~100)의 값입니다. max:%d",max);

   else

     printf("다시 입력해주세요.max:%d\n",max);

 }

 return 0;


밑에 1001 이 짠 코든데


while(getchar() != 10) max++;


대가리가 빠가라 이게 어떻게 숫자사이에낀 문자를 걸러내는지를모르겠음


1a1a1a하면 max=5고 a1a1a1하면 6이던데 왜저렇게되는지좀알려줘