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