fork(2) download
  1. #include <iostream>
  2.  
  3. int main() {
  4.  
  5. const unsigned columns = 3, rows = 3;
  6.  
  7. int arr[columns][rows] = {
  8. { 3, 2, 1 },
  9. { 7, 6, 5 },
  10. { 10, 5, 5 }
  11. };
  12.  
  13. bool sort = false;
  14. for (int i = 0; i < columns; i++) {
  15. for (int j = 1; j < rows; j++) {
  16. if (arr[i][j] < arr[i][j-1]) {
  17. sort = true;
  18. }
  19. else {
  20. sort = false;
  21. goto endsort;
  22. }
  23. }
  24. }
  25. endsort:
  26. std::cout << sort << std::endl;
  27. system("pause");
  28. return 0;
  29. }
Success #stdin #stdout #stderr 0s 4268KB
stdin
Standard input is empty
stdout
0
stderr
sh: 1: pause: not found