Created
May 2, 2023 00:58
-
-
Save STCollier/2b6b6707bb72fa8aa3ee084f717004b2 to your computer and use it in GitHub Desktop.
Golfed code that converts a 10 digit number to a phone number. e.g., 1234567890 -> (123) 456-7890
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(){char s[10];scanf("%[^\n]",s);printf("(%.*s) %.*s-%.*s",3,s,3,s+3,4,s+6);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment