Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<iostream>
  2. #include<algorithm>
  3. #include<string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int n; cin >> n;
  10. for(int i=0; i<n; i++)
  11. {
  12. int walls,HJ=0,LJ=0;
  13. cin >> walls;
  14. int *arr = new int[walls];
  15. for (int j = 0; j < walls; j++)
  16. cin >> arr[j];
  17. for (int j = 0; j < walls-1; j++)
  18. {
  19. if (arr[j] < arr[j + 1]) HJ++;
  20. if (arr[j] > arr[j + 1]) LJ++;
  21. }
  22. cout << "Case " << i + 1 << ": " << HJ << " " << LJ<<endl;
  23.  
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement