Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cmath>
- #include<fstream>
- #include<vector>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL(), "rus");
- vector<int>firm,profit, tax, goverprofit;
- int numbfirms;
- cout << " Введите кол-во фирм : ";
- cin >> numbfirms;
- for (int i = 0; i < numbfirms; i++)
- {
- int num=i;
- cout << "Номер фирмы : " << num + 1 << endl;
- firm.push_back(i);
- int prof;
- cout << "Введите доход " << i + 1 << " фирмы " << endl;
- cin >> prof;
- profit.push_back(prof);
- cout << "Введите налог для " << i + 1 << " фирмы " << endl;
- int taxx;
- cin >> taxx;
- tax.push_back(taxx);
- goverprofit.push_back(profit[i] * tax[i] / 100);
- }
- int maxtax = goverprofit[0];
- int maxprofit = firm[0];
- for (int i = 1; i < numbfirms; i++)
- {
- if (goverprofit[i] > maxtax)
- {
- maxtax = goverprofit[i];
- maxprofit = firm[i];
- }
- }
- for (int i = 0; i < numbfirms; i++)
- {
- cout << " Доход " << i + 1 << " фирмы = " << profit[i] << endl;
- cout << " Налог " << i + 1 << " фирмы = " << tax[i] << endl;
- cout << " Государь получает " << i + 1 << " фирмы = " << goverprofit[i] << endl;
- cout << endl;
- }
- cout << "Наибольший доход государь получает со " << maxprofit + 1 << " фирмы" << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement