title: fgets doesn't work after scanf
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;ctype.h&gt;
  
  void delspace(char *str);
  
  int main() {
      int i, loops;
      char s1[101], s2[101];
  
      scanf("%d", &amp;loops);
  
      while (loops--) {
          fgets(s1, 101, stdin);
          fgets(s2, 101, stdin);
          s1[strlen(s1)] = '\0';
          s2[strlen(s2)] = '\0';
  
          if (s1[0] == '\n' &amp;&amp; s2[0] == '\n') {
              printf("YES\n");
              continue;
          }
  
          delspace(s1);
          delspace(s2);
  
          for (i = 0; s1[i] != '\0'; i++)
              s1[i] = tolower(s1[i]);
  
          for (i = 0; s2[i] != '\0'; i++)
              s2[i] = tolower(s2[i]);
  
          if (strcmp(s1, s2) == 0) {
              printf("YES\n");
          }
          else {
              printf("NO\n");
          }
      }
  
      return 0;
  }
  
  void delspace(char* str) {
      int i = 0;
      int j = 0;
      char sTmp[strlen(str)];
  
      while (str[i++] != '\0') {
          if (str[i] != ' ') {
              sTmp[j++] = str[i];
          }
      }
      sTmp[j] = '\0';
      strcpy(str, sTmp);
  }
  </code></pre>
  
  <p>After I entered "loops", "s1" was assigned a blank line automatically. How does it happen? I'm sure my keyboard works fine. </p>