Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream fin("secvente.in");
- ofstream fout("secvente.out");
- const int nmax=1001;
- int a[nmax],n;
- int main()
- {
- fin>>n;
- for(int i=1;i<=n;i++)
- fin>>a[i];
- int sol=1;
- for(int i=2;i<=n;i++)
- if(a[i]<a[i-1])
- sol++;
- fout<<sol<<"\n";
- fin.close();
- fout.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement