Advertisement
patryk178

Untitled

Feb 5th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool czyjest(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. cin>>n;
  18. int T[n];
  19. cout<<"Podaj liczby";
  20. for(int i=0;i<n;i++)
  21. {
  22. cin>>T[i];
  23. }
  24.  
  25. if(czyjest(T,n)==true)cout<<"Jest malejacy";
  26. else cout<<"Nie jest malejacy";
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement