#C3288. Formatting Numbers with Commas
Formatting Numbers with Commas
Formatting Numbers with Commas
Your task is to insert commas as thousands separators into a given non-empty string representing a number.
For instance, the number 1234567
should be formatted as 1,234,567
.
Make sure your solution correctly handles both small and large numbers.
For example, given the input 1000
, the output should be 1,000
.
inputFormat
A single non-empty string of digits representing a number is read from standard input (stdin).
outputFormat
Output the formatted number as a string with commas inserted as thousand separators to standard output (stdout).## sample
1234567
1,234,567