Using cout instead of printf