19 - Simple Program Using a Loop

while(x<=5)

    {

        cin >> number;

        total=total+number;

        x++;

    }

    cout << "total is " << total << endl;

你可能感兴趣的