Advertisement
dzieciol

zad 2

Oct 21st, 2016
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. /*
  8. * File: main.cpp
  9. * Author: Tomek
  10. *
  11. * Created on 20 października 2016, 18:03
  12. */
  13.  
  14. #include <cstdlib>
  15. #include <iostream>
  16.  
  17. using namespace std;
  18.  
  19. class macierz
  20. {
  21. float a[3][3];
  22.  
  23. public:
  24. macierz(float tablica[3][3]){
  25. for(int i = 0; i<3; i++){
  26. for (int j=0;j<3;j++)
  27. a[i][j]=tablica[i][j];}}
  28. macierz(){
  29. for(int i = 0; i<3; i++){
  30. for (int j=0;j<3;j++)
  31. a[i][j]=1;}
  32.  
  33. }
  34. wyswietl();
  35.  
  36.  
  37.  
  38.  
  39. };
  40.  
  41.  
  42.  
  43.  
  44.  
  45. int main(int argc, char** argv) {
  46. /*
  47. ulamek u1;
  48. ulamek u2(1,4);
  49. u1.wyswietl();
  50. u2.wyswietl();
  51. */
  52. float tab[3][3] = {{1,2,3},{3,4,5},{5,6,7}};
  53. macierz m1(tab);
  54. macierz m2();
  55. m2.wyswietl;
  56.  
  57.  
  58.  
  59. return 0;
  60. }
  61. macierz::wyswietl(){
  62.  
  63. for(int i = 0; i<3; i++){
  64. for (int j=0;j<3;j++)
  65. cout<<a[i][j];
  66. cout<<endl;}
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement