Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main()
- {int w,k,i,j;
- cout<<"ile wierszy ma miec Twoja macierz?"<<endl;
- cin>>w;
- cout<<"Ile kolumny ma miec Twoja macierz?"<<endl;
- cin>>k;
- int macierza[w][k];
- int macierzb[w][k];
- int macierzc[w][k];
- cout<<"Podaj elementy macierzy A : ";
- cout<<" "<<endl;
- for(i=0; i<w; i++)
- for(j=0; j<k; j++)
- cin>>macierza[i][j];
- cout<<" \n\n";
- for(i=0; i<w; i++){
- {
- for(j=0; j<k; j++)
- cout<<macierza[i][j];
- }
- cout<<""<<endl;}
- cout<<"Podaj elementy macierzy B : ";
- cout<<" "<<endl;
- for(i=0; i<w; i++)
- for(j=0; j<k; j++)
- cin>>macierzb[i][j];
- cout<<" \n\n";
- for(i=0; i<w; i++){
- {
- for(j=0; j<k; j++)
- cout<<macierzb[i][j];
- }
- cout<<""<<endl;}
- for(int i=0;i<w;i++)
- {
- for(int j=0;j<k;j++)
- {
- macierzc[i][j] = macierza[i][j] + macierzb[i][j];
- cout<<macierzc[i][j]<<" ";
- }
- cout<<endl; }
- system("Pause");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement