Загрузка данных


#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int salary;
    int count[9] = { 0 };
    double sales;

    cout << "Enter sales (-1 to stop): ";

    while (cin >> sales && sales != -1) {
        salary = round(200 + 0.09 * sales);

        if (salary >= 1000)
            count[8]++;
        else if (salary >= 200)
            count[(salary - 200) / 100]++;
    }

    for (int i = 0; i < 8; i++) {
        cout << "$" << 200 + i * 100 << "-$"
            << 299 + i * 100 << ": "
            << count[i] << endl;
    }

    cout << "$1000 and over: " << count[8] << endl;

    return 0;