Question: Write a C++ program that accepts a positive integer $N$ indicating $N$ test cases. For each test case, the program accepts a word $W$ that

Write a C++ program that accepts a positive integer $N$ indicating $N$ test cases.

For each test case, the program accepts a word $W$ that contains only alphabets and stars (*). The program then shifts all stars to the left (hence also shifts all alphabets to the right) while maintaining the initial ordering of the alphabets.

For example, given the word $W$ below:

```

T**es*t***IsE***a******s*y**

```

After shifting, the word should become:

```

******************TestIsEasy

```

## Input Range

*The input to this program will only come from the following range. (Your code does not need to check if the input is in this range).*

- $1 \leq N \leq 10$

- $1 \leq W.length() \leq 100$

- $W$ contains alphabets and stars only.

-------------------------------------------------------------------------------------------

#include

using namespace std;

int main()

{

int N;

cout << "N -> ";

cin >> N;

for (int i = 1; i <= N; ++i)

{

cout << " Input:" << endl;

// --- Write your code here ---

cout << "Output:" << endl;

// --- Write your code here ---

}

}

--------------------------------------------------------------------

## Sample Run 1

```

N -> 4

Input:

**p***ro****gra**m*mi**n*g***

Output:

******************programming

Input:

***bie**be*ri***sba**rb****er

Output:

***************bieberisbarber

Input:

t**i**meis*g*ol**d**

Output:

**********timeisgold

Input:

Q**ata***rWo**rl*d*C**u*p

Output:

************QatarWorldCup

```

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!