Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int v[20],i,n,SA=0,c=0,nr=0;
- float MA;
- cout<<"n="; cin>>n;
- for (i=1;i<=n;i++)
- {
- cout <<"introduceti numere ";
- cin >> v[i];
- if ( i%2 == 1)
- {SA=SA+ v[i];
- nr=nr++;
- }
- }
- MA=SA/nr;
- cout<<"Media aritmetica este... "<<MA;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement