Guest User

Niz, rastuci?

a guest
Jun 14th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int jeste=0;
  7.     int niz[10];
  8.     for(int i=0; i<10; i++)
  9.     {
  10.         cin>>niz[i];
  11.     }
  12.  
  13.     for(int i=0; i<10; i++)
  14.     {
  15.         if(niz[i]<=niz[i+1])
  16.         {
  17.             jeste=1;
  18.             break;
  19.         }
  20.     }
  21.  
  22.     if(jeste)
  23.     {
  24.         cout<<"Niz je rastuci!"<<endl;
  25.     }
  26.     else
  27.     {
  28.         cout<<"Niz je opadajuci"<<endl;
  29.     }
  30.     system("PAUSE");
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment