Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <math.h>
- #define pi 3.1415
- using namespace std;
- int main()
- {
- const int n = 4;
- float arr[n], arr2[n], sum = 0;
- for (int i = 0; i < n; i++)
- {
- cin >> arr[i];
- }
- for (int i = 0; i < n; i++)
- {
- arr2[i] = 1 - ( (arr[i] - 1) / 8 );
- }
- for (int i = 0; i < n; i++)
- {
- cout << "C" << i << " = " << arr2[i] << endl;
- sum += arr2[i];
- }
- cout << "sum = " << sum << endl;
- for (int i = 0; i < n; i++)
- {
- cout << "B" << i << " = " << arr2[i] / sum << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement