// Solution as follows
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
//accept the count of test cases given in the the 1st line
cin>>t;
//Run a loop to accept 't' inputs
while(t--)
{
int N;
//accept an integer N in each test case
cin>>N;
//output the number mirror for each test case
cout<<N<<endl;
}
return 0;
}
Hello there;
the main idea in this problem is the input and output syntax in c++ as well as printing separated lines for each test case, the solution is as simple as it’s.
first we can get the input through "cin>>input " command.
second we can get the output through “cout<<output” command.
third to print each test case in a new line , we need to loop on the number of test cases , in this case ‘t’ , and use endl; at the end of output command syntax , so now to output:
“cout<<output<<endl;”
int main()
{
int t;
//accept the count of test cases given in the the 1st line
cin>>t;
//Run a loop to accept ‘t’ inputs
while(t–)
{
int n;
cin>>n;
cout<<n<<endl;
}
return 0;
}