Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- int main()
- {int v[100],i,min,max;
- unsigned n,par;
- cout<<"n=";cin>>n;
- min=0;
- for(i=0;i<n;i++)
- {
- cout<<"v[" << i << "]=";
- cin>> v[i];
- }
- min=v[0];
- for(i=1;i<n;i++)
- if(v[i]<min)
- min=v[i];
- max=0;
- for(i=0;i<n;i++)
- if(v[i]>max)
- max=v[i];
- par=0;
- for(i=0;i<n;i++)
- if(v[i]%2==0)
- par++;
- cout<<"Cel mai mic element din vectorul V este:"<<min;
- cout<<endl<<"Cel mai mare element din vectorul V este:"<max;
- cout<<endl<<"Cate elemente pare are V:"<par;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement