Pascal Implementation For Counting In Cpp