Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Дано дійсні числа a1, a2, …, a30, b1, b2, …, b30.
- // Обчислити (a1 + b30)(a2 + b29)…(a30 + b1).
- vector<double> a(30,1);
- vector<double> b(30,1);
- vector<double>::iterator it_a;
- vector<double>::reverse_iterator it_b;
- double sum=0;
- double dob=1;
- for (it_a=a.begin(), it_b=b.rbegin();
- it_a!=a.end();
- it_a++, it_b++)
- {
- dob*=(*it_a + *it_b);
- }
- cout << dob << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement