1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include<iostream>
#include<numeric>
#include<vector>
#include<iomanip>
using namespace std;
int main()
{
//char vowels[]={'a','i','e','o','u'};
vector <vector<int>> v{ {2400, 3500, 2000},
{1500, 7000, 1000 },
{ 600, 450, 2100 },
{790, 240, 500},
{1000, 1000, 1000} ,
{6300, 7000, 8000},
{1300 ,450, 700} ,
{2700, 5500, 6000},
{4700, 4800, 4900} ,
{1200, 1300 ,400}
};
cout<<"total"<<setw(10)<<"bonus"<<endl;
for(auto x:v){
//cout<<vowels[i]<<" = "<<count(str.begin(),str.end(),vowels[i])<<endl;
auto t= accumulate(x.begin(),x.end(),0);
cout.precision(2);
cout<<fixed<<t<<setw(10)<<t/10<<endl;
}
return 0;
}
|