Advertisement
Guest User

Untitled

a guest
May 28th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. bool isSorted(const int array[], int size)
  6. {
  7.     for (int i = 0; i < 80; i++)
  8.     {
  9.         array[i];
  10.         size = array[0];
  11.        
  12.         if (array[i] > array[i-1])
  13.         {
  14.             return true;
  15.         }
  16.  
  17.         else
  18.         {
  19.             return false;
  20.             break;
  21.         }
  22.     }
  23. }
  24. int main()
  25. {  
  26.     int array[80];
  27.     int size = array[0];
  28.     cout << "Enter List: ";
  29.     bool output = isSorted(array, size);
  30.     if (output == true)
  31.         cout << "The list is sorted";
  32.     if (output == false)
  33.         cout << "The list is not sorted";
  34.  
  35.     system("pause");
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement