Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- { int a,b,c,d;
- printf("DODAWANIE MACIERZY\n\n");
- printf("Podaj liczbe wierszy macierzy:");
- scanf("%d",&a);
- printf("Podaj liczbe kolumn macierzy:");
- scanf("%d",&b);
- int W[a][b];
- int K[a][b];
- int I[a][b];
- printf("\nWpisz element pierwszej macierzy\n\n");
- for(c=0;c<a;c++){
- for(d=0;d<b;d++)
- {printf("Podaj element:"); scanf("%d",&W[c][d]);}
- }
- printf("\nMacierz :\n");
- for(c=0;c<a;c++){printf("\n");
- for(d=0;d<b;d++)
- {printf("%d",W[c][d]);}
- }
- printf("\n\nWpisz element drugiej macierzy\n\n");
- for(c=0;c<a;c++){
- for(d=0;d<b;d++)
- {printf("Podaj element:"); scanf("%d",&K[c][d]);}
- }
- printf("\nMacierz :\n");
- for(c=0;c<a;c++){printf("\n");
- for(d=0;d<b;d++)
- {printf("%d",K[c][d]);}
- }
- printf("\nSuma macierzy :\n");
- for(c=0;c<a;c++){printf("\n");
- for(d=0;d<b;d++){printf("%d",I[c][d]=W[c][d]+K[c][d]);}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement