Objective Give
practice with reading and writing to standard input in C.
Give practice with loops and conditionals in C.
Story
You have just entered the mystical Gameland and you wish to earn some coins. There is a low paying beurotractic job you have been granted. It’s fairly simple. You will take in someone’s name and generate a handle based on it. The rules for generating a handle are pretty simple.
1. Any letter that is not the first or last letter of a name is removed and
2. any spaces are removed as well. For example John Smith becomes JnSh. You have a lot of names to process, so you decided to write a program to do the work for you so you can do other things while the money comes in.
Problem
Given a list of newline-separated names consisting of only upper and lower case letters and spaces, generate a handle for each using the given rules.
Input
Input will begin with a line containing 1 integers, n (1 ≤ n ≤ 100,000), representing the number of names to process. The following n lines will each contain a single name to process. Each name will have at most 100,000 characters of which can be upper or lower case Latin letters or spaces.
Each name will have at least one non-space character.
Get Free Quote!
385 Experts Online