Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int v[100], n, i, a, b, c;
- int main()
- {
- cout<<"n= "; cin>>n;
- for(i=0; i<n; i++)
- {
- cout<<"v["<<i<<"]= "; cin>>v[i];
- }
- cout<<"a= "; cin>>a;
- cout<<"b= "; cin>>b;
- for(i=0; i<n; i++)
- {
- if(v[i] >= a && v[i] <= b)
- {
- cout<<v[i]<<' ';
- c++;
- }
- }
- cout<<c<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment