Facebook
From Soiled Wolf, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 262
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.  
  9. //int **tab, k, w;
  10. /*  cout<<"Podaj liczbę wierszy: ";
  11.  
  12.   cin>>w;
  13.  
  14.   tab = new int *[w];
  15.  
  16.   for(int i=0;i<w;i++)
  17.   {
  18.     cout<<"Podaj liczbę komórek w wierszu o numerze "<<i<<": ";
  19.     cin>>k;
  20.     tab[i] = new int[k];
  21.   }
  22.  
  23.  */
  24.  
  25.   cout<<"macierz a"<<endl ;
  26.  
  27. int tab[4][4] = {{1,-4,4,-4},{1.5,-1, 2, -2},{1.5,-0.5,0, -3}, {4.5,-5.5,4, -5}};
  28. for(int i=0;i<4;i++)
  29.         {       for(int j=0;j<4;j++)
  30.                 {
  31.                         cout<<tab[i][j];
  32.                 }
  33.         }
  34.        
  35. int tabb[4][1]={{-9},{-3.5}, {-2}, {-14}};
  36.  
  37.  
  38.  
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.   //zwolnienie pamięci
  54.   for(int i=0;i<w;i++)
  55.     delete [] tab[i];
  56.  
  57.   delete [] *tab;