How to take sample input of this without n

There is no input n and direct parentheses

Hi @rakshitgangwar
There are two ways to do it :

  1. either use char array like :
    char s[100];
    cin>>s;

  2. or use string like :
    string s;
    cin>>s;