Advertisement
Guest User

Labolatorium2

a guest
Jan 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include <iostream>
  2. #include <utility>
  3. #include "Macierz.h"
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7. int main(int argc, char** argv) {
  8.     Macierz A = Macierz(2,2);
  9.     Macierz C = Macierz(4,2);
  10.  
  11.     Macierz K = A;
  12.     cout<<"\nAdres A macierzy przed przenoszeniem: "<<A.daj_adres_komorki();
  13.     Macierz P(move(A));
  14.  
  15.     cout<<"\nAdres A macierzy po przenoszeniu: "<<A.daj_adres_komorki();
  16.     cout<<"\nAdres macierzy P: "<<P.daj_adres_komorki();
  17.     cout<<"\nWypelnianie macierzy P:\n";
  18.     P.wypelnijMacierz();
  19.     cout<<"\nWypelnianie macierzy C:\n";
  20.     C.wypelnijMacierz();
  21.     cout<<"\nMacierz P";
  22.     P.wyswietlMacierz();
  23.     cout<<"\nMacierz C";
  24.     C.wyswietlMacierz();
  25.    
  26.     cout<<"\nDodawanie macierzy C do macierzy C";
  27.     C.dodajMacierz(C);
  28.     cout<<"\nMacierz C";
  29.     C.wyswietlMacierz();
  30.     cout<<"\nMnozenie macierzy P przez skalar";
  31.     int skalar;
  32.     cout<<"\nPodaj liczbe: ";
  33.     cin>>skalar;
  34.     P.pomnozPrzezSkalar(skalar);
  35.     cout<<"\nMacierz P";
  36.     P.wyswietlMacierz();
  37.     cout<<"\nMnozenie macierzy P przez C";
  38.     Macierz wynik=P.pomnozPrzezMacierz(C);
  39.     cout<<"\nMacierz wynik:";
  40.     wynik.wyswietlMacierz();
  41.     cout<<"\nKoniec programu";
  42.     getch();
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement