Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int dim = 4;
- int main()
- {
- int a[dim][dim] = {1,0,0,0,
- 1,2,0,0,
- 1,1,3,0,
- 1,1,1,4};
- int k = 0;
- int r = dim-1;
- while(k < dim-2)
- {
- for(int j = 1; j < dim; j++)
- {
- cout << a[k][j];
- if(j == dim-1)
- {
- k++;
- j = k;
- }
- if(a[k][j] == a[k][j+1])
- {
- cout <<"si" <<"\n";
- }
- else
- {
- cout <<"no\n";
- }
- }
- cout <<"\n";
- }
- cout <<"Ultima riga\n";
- for(int j = 0; j < dim; j++)
- {
- if(a[k][j] != 0)
- cout <<"ok\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement