Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void cit3(int &n, int &m, int a[10][10])
- {
- int i,j;
- cout<<"n=";
- cin>>n;
- cout<<"m=";
- cin>>m;
- for (i=1;i<=n;i++)
- for (j=1;j<=m;j++)
- cin>>a[i][j];
- }
- int coloana3(int n, int m, int a[10][10], int x)
- {
- int i;
- for (i=1;i<=n-1;i++)
- if (a[i][x]!=a[i+1][x])
- return 0;
- return 1;
- }
- void indice3(int n, int m, int a[10][10])
- {
- int j;
- for (j=1;j<=m;j++)
- if (coloana3(n,m,a,j)==1)
- cout<<j<<" ";
- }
- int main()
- {
- int m,n,a[10][10];
- cit3(n,m,a);
- indice3(n,m,a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement