fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n,k=0; cin >> n;
  6. double a[n][n]; int b[n];
  7. for (int i=0; i<n; i++){
  8. for (int j=0; j<n; j++){
  9. cin >> a[i][j];
  10. }
  11. }
  12. for (int i=0; i<n; i++){
  13. b[i]=1;
  14. for (int j=0; j<n-1; j++){
  15. if (a[i][j]>a[i][j+1]){b[i]=0; break;}
  16. }
  17. }
  18. for (int i=0; i<n; i++){cout << b[i]<<" ";}
  19. }
Success #stdin #stdout 0s 3476KB
stdin
5
1 2 3 4 5
6 5 4 3 2 
0 1 2 3 4
-5 1 3 4 0
1 3 3.5 4.3 5 
stdout
1 0 1 0 1