Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<algorithm>
- #include<string>
- using namespace std;
- int main()
- {
- int n; cin >> n;
- for(int i=0; i<n; i++)
- {
- int walls,HJ=0,LJ=0;
- cin >> walls;
- int *arr = new int[walls];
- for (int j = 0; j < walls; j++)
- cin >> arr[j];
- for (int j = 0; j < walls-1; j++)
- {
- if (arr[j] < arr[j + 1]) HJ++;
- if (arr[j] > arr[j + 1]) LJ++;
- }
- cout << "Case " << i + 1 << ": " << HJ << " " << LJ<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement