Why the program doesn't stop for user enter value?

My issue

My code

#include <iostream>
#include <string>
using namespace std;

int main()
{
 
  string student[5];
  
  for(int i=0;i<5;i++)
  {
     cout<<"enter name  "<<i<< "\n";
     cin>>student[i];
     
  }
  
  return 0;
}

Problem Link: PRACTICEPERF Problem - CodeChef