RafalSobala

tablice zad 15

Apr 19th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a,z=0;
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11.     int tab[a][a];
  12.     cout << "Podaj wielkosc tablicy: " << endl;
  13.     cin >> a;
  14.  
  15.     for(int i=0;i<a;i++){
  16.         for(int j=0;j<a;j++){
  17.           if(z==j){
  18.             cout << "0";
  19.           }
  20.           else{
  21.             cout << "1";
  22.           }
  23.         }
  24.         z=z+1;
  25.         cout<<endl;
  26.  
  27.     }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.     return 0;
  35. }
Add Comment
Please, Sign In to add comment