First I ask the user if he wants a method or another (1 or 2)
After processing that I start reading lines with getline to store them in a string vector, but the first line I read is " " (I guess it is because of the cin >> I use at the beginning). The only solution I found is to put an extra getline(cin, s);
When used immediately after whitespace-delimited input, e.g. after int n; std::cin >> n;, getline consumes the endline character left on the input stream by operator>>, and returns immediately. A common solution is to ignore all leftover characters on the line of input with cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); before switching to line-oriented input.
...The solution is to add std::cin.ignore(); immediately after the first std::cin statement. This will grab a character off of the input buffer (in this case, newline) and discard it...