Advertisement
patryk178

Untitled

Feb 4th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool monotonicznosc(int T[],int n)
  6. {
  7. for(int i=0;i<n-1;i++)
  8. {
  9. if(T[i]<=T[i+1])return false;
  10. }
  11. return true;
  12. }
  13.  
  14. int main()
  15. {
  16. int n;
  17. cout<<"Podaj n: ";cin>>n;
  18. int T[n];
  19. for(int i=0;i<n;i++)
  20. {
  21. cin>>T[i];
  22. }
  23.  
  24. if(monotonicznosc(T,n)==true)cout<<"Tak";
  25. else cout<<"Nie";
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement