showing SIGTSTP ....cannot figure out why?

wrote and the program worked on different IDEs but when i run it on codechef …it shows SIGTSTP error…can anyone point out the mistake?
The problem is this.

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int i=0;
  char temp;
  int sol_num;
  int ready=0;
  int not_ready=0;
  scanf("%d",&sol_num);
  int arr[sol_num];
  do
  {
      scanf("%d%c", &arr[i], &temp);
      i++;
  }
  while(temp != '\n');
  for(int j=0;j<i;j++)
  {
      if((arr[j]%2)==0)
      {
          ready++;
      }
      else
      {
          not_ready++;
      }
  }
  if(ready>not_ready)
  {
      printf("READY FOR BATTLE");
  }
  else
  {
      printf("NOT READY FOR BATTLE");
  }


}

The issue is coming due to this loop:

  do
  {
      scanf("%d%c", &arr[i], &temp);
      i++;
  }
  while(temp != '\n');

Here you are trying to input a character temp but as far as I know in C/C++ space and end of line isn’t recognized until we take the entire line as a string so here you need not input the character temp.

This loop should work:

  do
  {
      scanf("%d", &arr[i]);
      i++;sol_num--;
  }
  while(sol_num>0);

thanks …the error is resolved.