Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <math.h>
- #define I 5
- #define J 4
- int main(){
- float A[I][J],B[I],A1[J],B1[J],A2[J];
- int IM,max;
- printf("Vvedite matricy A\n");
- for(int i = 0;i<I;i++){
- for(int j=0;j<J;j++){
- printf("Vvedite element %iX%i\t",i+1,j+1);
- scanf("%f",&A[i][j]);
- }
- }
- printf("B\n");
- for(int j =0;j<J;j++){
- B[j]=sin(j+1)+cos(j+1);
- printf("%f\t",B[j]);
- }
- printf("\n");
- max = A[0][0];
- for(int i=0;i<I;i++)
- for(int j=0;j<J;j++)
- if(A[i][j]>max){
- max=A[i][j];
- IM = i;
- }
- printf("IM = %i\n",IM+1);
- printf("A1:\n");
- for(int j = 0;j<J;j++){
- A1[j]=A[IM][j];
- printf("%f\t",A1[j]);
- }
- printf("\n");
- for(int j = 0;j<J;j=j+2){
- A2[j]=A1[j+1];
- A2[j+1]=A1[j];
- B1[j]=B[j+1];
- B1[j+1]=B[j];
- }
- printf("A2\n");
- for(int j=0; j<J;j++)
- printf("%f\t",A2[j]);
- printf("\n");
- printf("B1\n");
- for(int j=0;j<J;j++)
- printf("%f\t",B1[j]);
- printf("\n");
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment