You are mixing the extraction operator >> (on line 8) with getline (on line 13).
The extraction operator takes the number that you put in ... but doesn't clear the linefeed. So the first getline() call clears the rest of the line (which is probably blank) up to that first linefeed.
They are difficult to mix: either accept it and use a dummy getline statement to dump the rest of the line after the cin statement, or (probably better here) use getline for everything here and stringstream the first input into n.
Your program would be a lot easier for others to use if it had some prompts and the indentation was consistent.
Line 8 reads an integer. (formatted input)
Line 13 reads up to next newline character and stores data to x[0] (on first iteration). (unformatted input)
What is in the input?
2
hello
world
Lets illustrate newlines in that:
2\n
hello\n
world\n
Lets read the integer. What remains:
\n
hello\n
world\n
The first line to read has only newline.
Lets type input differently:
2 hello\n
world\n
After reading integer:
hello\n
world\n
Alas, x[0] will start with a whitespace.
Mixing formatted and unformatted input is tricky. You should somehow erase all whitespace after the integer before the first "string". See http://www.cplusplus.com/reference/istream/ws/
Why do you loop (on lines 20 and 21) up to 25?
How do you know that a string has 26 characters?
How do you know that a string has even 1 character? Your x[0] has probably 0 (depending on your input).
If that is true, then size() returns 25 for each string.
If it is not true, the size() will still return a safe value.
Literal constants in the code (like the 25) are referred to as "magic". It is impossible to tell from a number, what does it represent. If the code has unrelated numbers that happen to have same value the reading becomes even more difficult. If the value should change, you would have to edit each occurrence of the magic constant.