#include <iostream>
#include <vector>
using namespace std;
#define _MAXNUMBER 6
class chgech
{
public:
vector<char> charray;
};
template<class T>
void f(T m_ch, int n)
{
if(n>0)
{
cout<<m_ch.charray[n-1]<<" ";
}
else
return;
f(m_ch, n-1);
}
int main()
{
char ch;
chgech m_ch;
int i=0;
for(i=0; i<_MAXNUMBER; i++)
{
cin>>ch;
m_ch.charray.push_back(ch);
}
f(m_ch, 6);
return 0;
}
看是不是你想要的。