Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "RUS");
- {int a[4][4];
- for (int i = 0; i < 4; i++)
- for (int j = 0; j < 4; j++)
- cin >> a[i][j];
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 4; j++)
- cout << a[i][j] << " ";
- cout << "\n";
- }
- }
- double sr = 0, k = 0;
- int a[4][4];
- for (int i = 0; i < 4; i = i + 1)
- for (int j = 0; j < 4; j = j + 1) {
- {if (i + j >= 4 && a[i][j] < 0) sr = sr + a[i][j], k = k + 1,cout<<"HERE"; }
- }
- cout << "sr before=" << sr << endl;
- cout << "k berofe=" << k << endl;
- sr = sr / k;
- cout << "sr=" << sr << endl;
- cout << "k=" << k << endl;
- int i=1;
- double p = 1;
- for (int j = 0; j < 4; j = j + 1) {
- p = p * (cos(fabs(a[1][j]) + 3 * j));
- }
- cout << "p=" << p << endl;
- for (i = 0; i < 4; i = i + 1)
- {
- double s = 0;
- double c[4];
- for (int j = 0; j < 4; j = j + 1)
- s = s + a[i][j];
- {c[i] = s;
- }
- cout << setw(10) << "c[i]" << endl;
- for (i = 0; i < 4; i = i + 1)
- {
- cout << setw(10) << c[i] << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement