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