class Solution
{
public:
vector<int> printListReversingly(ListNode* head)
{
vector<int> v;
while(head)
{
v.push_back(head->val);
head=head->next;
}
return vector<int>(v.rbegin(),v.rend());
/*for(int i=0; i<v.size()/2; i++)
{
swap(v[i],v[v.size()-i-1]);
}
return v;*/
}
};