#include <algorithm>
#include <iostream>
#include <vector>

static bool comp(int a, int b)
{
    //lambda function evaluates to true - no swap, 
    //evaluates to false -swap
    if(a==0) return false;
    if(b==0) return true;
    //if neither a nor b is 0 them do not swap
    return false;
}

void moveZeros(std::vector<int>& nums)
{
    std::stable_sort(nums.begin(),nums.end(),comp);
}

int main(int argc, char** argv)
{
	std::vector<int> vec = {0,14,0,3,12};
	moveZeros(vec);
	
	for(auto v : vec)
		std::cout << v << ' ';
	std::cout << '\n';
}