Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool is_triangular(int** tab, int n) {
- bool check1=true;
- bool check=true;
- for(int i=1; i<n; i++)
- for(int j=0; j<i; j++)
- {
- if(tab[i][j]!=0)check=false;
- }
- for(int i=1; i<n; i++)
- for(int j=n-1; j>n-1-i; j--)
- {
- if(tab[i][j]!=0)check1=false;
- }
- return check || check1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement