Read in a string from cin (it will not have any whitespace). Print out the first character, middle character (if string is an even length, print the second of the two middle letters), and last character without any spaces.
Samples:
Input: hello Output: hlo
Input: number Output: nbr
Hints:
- To get the middle/last you will need to first get the length of the string and calculate based on that
- The index of the last letter is not the same as the length! In "hello", the 'o' is at location 4
Code:
#include <iostream>
#include <string>
using namespace std;
//Turn off loops - you should not need them!
#define for "OhNoYouDont"
#define while "GetThatOutOfMyKitchen"
//Do not modify anything on or above the line below this
//YOUR_CODE_BELOW
int main()
{
//YOUR_CODE
}