Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void imie()
  6. {
  7. cout<<"Napisane przez: Adam Arasimowicz"<<endl;
  8. }
  9. void algorytm()
  10. {
  11. cout<<"dwuwymiar"<<endl;
  12. }
  13. int main()
  14. {
  15. imie();
  16. algorytm();
  17.  
  18. int i,j,m,n;
  19. cout<<"podaj liczbe kolumn: ";
  20. cin>>n;
  21. cout<<"podaj liczbe wierszy: ";
  22. cin>>m;
  23.  
  24. int tab[m][n];
  25.  
  26. cout<<endl;
  27. for(i=0;i<m;i++)
  28. {
  29. for(j=0;j<n;j++)
  30. {
  31. if(j==0||i==j)
  32. {
  33. tab[i][j]=1;
  34. cout<<tab[i][j];
  35. }
  36. else
  37. {
  38. tab[i][j]=0;
  39. cout<<tab[i][j];}
  40. }
  41. cout<<endl;
  42. }
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement