fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n;
  7. cin >> n;
  8. double z[n][n], b[n];
  9. for(int i = 0; i < n; i++)
  10. {
  11. for(int j = 0; j < n; j++)
  12. {
  13. cin >> z[i][j];
  14. }
  15. }
  16. for (int i = 0; i < n; i++)
  17. {
  18. b[i] = 0;
  19. for(int j = 0; j < n; j++)
  20. if(z[i][j] < 0)
  21. {
  22. b[i] = 1;
  23. break;
  24. }
  25. }
  26. for (int i = 0; i < n; i++)
  27. {
  28. cout << b[i] << " ";
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 3432KB
stdin
3
-0.75 0.98 4.67
4.89 0 3.75
-9.85 0 2.65
stdout
1 0 1