Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include < math.h >
- #include <iomanip>
- double round (double x)
- {
- setlocale(LC_ALL, "Russian");
- (int ((x+0.5)*pow(10,2)))/pow(10,2);
- return 0;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int i,j,jmax;
- long double x1,x2,x3,y1,y2,y3,max;
- long double A[3][4];
- long double B[3][4];
- long double C[3][4];
- A[1][1]=1.2345; A[2][1]=2.3456; A[3][1]=3.4567; A[1][2]=3.1415; A[1][3]=1; A[1][4]=7.7975; A[2][2]=5.9690; A[3][2]=2.1828; A[2][3]=0; A[2][4]=14.2836; A[3][3]=2.8; A[3][4]=8,6063;
- cout << "Матрица А \n" << endl;
- for (i=1; i<4; i++)
- {
- for (j=1; j<5; j++)
- cout << A[i][j] << "\t";
- cout << endl;
- }
- max=0;max=A[1][1];
- for(j=1;j<4;j++)
- {
- if(max<A[1][j])
- {
- max=A[1][j];
- jmax=j;
- }
- }
- cout << "Максимальный элемент 1 строки" << endl;
- cout << max << endl;
- for(i=1;i<4;i++)
- {
- swap(A[i][1],A[i][jmax]);
- }
- for (i=1; i<4; i++)
- {
- for (j=1; j<5; j++)
- cout << A[i][j] << "\t";
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement