Facebook
From Anorexic Horse, 5 Years ago, written in C++.
This paste is a reply to c++ from Cygan - view diff
Embed
Download Paste or View Raw
Hits: 432
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. // DLA ANGELIKI EM OD BARTŁOMIEJA EL
  5.  
  6. int const nmax=10;
  7. void tablice(int tab[][nmax],int &k,int &w);
  8. void wyswietl(int tab[][nmax],int &k,int &w);
  9. int main()
  10. {
  11.     int tab[nmax][nmax];
  12.     int k;
  13.     int w;
  14.     tablice(tab,k,w);
  15.     wyswietl(tab,k,w);
  16.  
  17.  
  18.     return 0;
  19. }
  20. void tablice(int tab[][nmax],int &k,int &w)
  21. {
  22.     cout<<"Podaj ilosc wierszy";
  23.     cin>>w;
  24.     cout<<"Podaj kolumn";
  25.     cin>>k;
  26.  
  27.     for(int i=0; i<w; i++)
  28.     {
  29.         for(int j=0; j<k; j++)
  30.         {
  31.             tab[i][j]=0;
  32.         }
  33.  
  34.     }
  35. }
  36. void wyswietl(int tab[][nmax],int &k,int &w)
  37. {
  38.     for(int i=0; i<w; i++)
  39.     {
  40.         for(int j=0; j<k; j++)
  41.         {
  42.              cout<<tab[i][j]<<" ";
  43.         }
  44.            cout<<endl;
  45.     }
  46. }
  47.