Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int the_checker(int arr[], int siz)
- {
- int cnt = 0;
- for(int i = 0; i < siz - 2; i++)
- {
- if(arr[i] < arr[i + 1] && arr[i + 1] < arr[i + 2])
- {
- cout << arr[i] << " " << arr[i + 1] << " " << arr[i + 2] << endl;
- cnt++;
- }
- }
- return cnt;
- }
- int main()
- {
- int arr[] = {1, 4, 6, 2, 3, -1, 6, 7, 8, 10, 11};
- cout << the_checker(arr, sizeof(arr)/sizeof(arr[0]));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement