Programm wartet nicht auf cin

int x=0;
string fullname = "";
float salary;
float payincrease;
float newsal;
float monthlysal;
float retroactive;
while(x<3){
    cout << "\n What is your full name?";
    cin >> fullname;
    cout << "\n What is your current salary? \t";
    cin >> salary;
    cout << "\n What is your pay increase? \t";
    cin >> payincrease;
    newsal = (salary*payincrease)+salary;
    monthlysal = newsal/12.00;
    retroactive = (monthlysal*6)-(salary/2);
    cout << "\n" << fullname << "'s SALARY INFORMATION";
    cout << "\n New Salary \t Monthly Salary \t Retroactive Pay";
    cout << "\n \t" << newsal << "\t" << monthlysal << "\t" << retroactive;
    x++;
}

Meine Schleife scheint nicht jedes Mal anzuhalten, wenn cin gefragt wird. Stattdessen wird die Schleife sofort dreimal von selbst ausgeführt. Wie bringe ich es zum Stoppen, wenn eine Eingabe angefordert wird?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage