MAQ Software Interview Question

convert MAQ to ZBH in c++