[BOJ 5949] Adding Commas
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
1.0s
Memory limit:
128M
Problem type
Allowed languages
Bessie is working with large numbers N (1 <= N <= 2,000,000,000) like 153920529 and realizes that the numbers would be a lot easier to read with commas inserted every three digits (as is normally done in the USA; some countries prefer to use periods every three digits). Thus, she would like to add commas: 153,920,529. Please write a program that does this.
입력 형식
- Line 1: A single integer: N </ul>
- Line 1: The integer N with commas inserted before each set of three digits except the first digits (as traditionally done in many cultures) </ul>
출력 형식
예제 입력
153920529
예제 출력
153,920,529
Comments