Advertisement
Anik_Akash

test

Oct 8th, 2020
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. //thanks God For Every Thing!
  2. //contest link:
  3.  
  4. //#include<bits/stdc++.h>
  5. #include<iostream>
  6. #include<string>
  7. #include<algorithm>
  8. #include<cstdio>
  9. #define pi           acose(-1)
  10. #define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n');
  11. #define wow          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  12. #define NL           printf("\n")
  13.  
  14. using namespace std;
  15.  
  16. typedef long long int           ll;
  17. typedef double                  dl;
  18.  
  19. // ---------------------- slove---------------------------//
  20.  
  21.  
  22. int main()
  23. {
  24.     int arr[6];
  25.  
  26.     for(int i=0; i<5; i++)
  27.     {
  28.         cin>>arr[i];
  29.     }
  30.  
  31.     int cnt1=0, cnt2=0;
  32.  
  33.     for(int i=0; i<5; i++)
  34.     {
  35.         if(arr[i]<arr[i+1])
  36.         {
  37.             cnt1++;
  38.         }
  39.     }
  40.  
  41.     for(int i=0; i<5; i++)
  42.     {
  43.         if(arr[i]>arr[i+1])
  44.         {
  45.             cnt2++;
  46.         }
  47.     }
  48.  
  49.     cout<<cnt1<<endl;
  50.     cout<<cnt2<<endl;
  51.  
  52.     return 0;
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement