Advertisement
rootuss

tablica 3x4

Dec 16th, 2016
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void wpisz (int T[3][4])
  6. {
  7.     for(int i=0; i<3;i++)
  8.     {
  9.         for(int j=0;j<4; j++)
  10.         {
  11.             cout<<"T["<<i<<"]["<<j<<"]= ";
  12.             cin>>T[i][j];
  13.         }
  14.     }
  15. }
  16.  
  17. void wypisz (int T[3][4])
  18. {
  19.     for(int i=0; i<3;i++)
  20.     {
  21.  
  22.         for(int j=0;j<4; j++)
  23.         {
  24.             cout<<"T["<<i<<"]["<<j<<"]= ";
  25.             cout<<T[i][j]<<" ";
  26.         }
  27.         cout<<endl;
  28.     }
  29. }
  30.  
  31.  
  32. void wyzeruj (int T[3][4])
  33. {
  34.     int wiersz;
  35.     cout<<"\n\nPodaj wiersz do wyzerowania: ";
  36.     cin>>wiersz;
  37.  
  38.         for(int j=0;j<4; j++)
  39.         {
  40.             T[wiersz][j]=0;
  41.         }
  42.         cout<<endl;
  43.  
  44. }
  45.  
  46. int main()
  47. {
  48.     cout << "Hello world!" << endl;
  49.  
  50.     int Tab[3][4];
  51.  
  52.     wpisz(Tab);
  53.     cout<<endl;
  54.     wypisz(Tab);
  55.  
  56.     wyzeruj (Tab);
  57.  
  58.     wypisz(Tab);
  59.  
  60.  
  61.  
  62.     return 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement