I am completely new to C++ and I was trying to make a program which repeated the phrase you entered how many times you want but it doesn't print out the first word.
#include <iostream>
using std::string;
using std::cin;
int main(){
std::string phrase;
int i;
int x;
std::cout << "Enter the number of times will be printed:\n";
std::cin >> x;
std::cout << "Now enter the phrase you want to be repeated:\n";
std::cin >> phrase;
getline(std::cin,phrase);
while (i < x) {
std::cout << phrase << "\n";
i++;
}
}