input : 2 //(number of case)
4 5 6 0
output : 3: 6 5 4 0
input : 1 2 3 0
output : 3: 3 2 1 0
#include <iostream>
#include <stack>
using namespace std;
int main()
{
int k=0 ,j=0, num, Case ;
stack<int> myStack;
cin>>Case;
while(j<Case)
{
k=0;
cout<<endl;
cin>>num;
while(num!=0)
{
k++;
myStack.push(num);
cin>>num;
}
cout<<endl;
cout<<k<<" : ";
while (!myStack.empty())
{
cout<<myStack.top()<<" ";
myStack.pop();
}
j++;
}
return 0;
}