Replace cout with printf