daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n,i,S=0,med;
  8.     cout<<"n=";
  9.     cin>>n;
  10.     int v[n];
  11.     for(i=0;i<n;i++)
  12.     {
  13.         cout << "v["<<i<<"]=";
  14.         cin>>v[i];
  15.     }
  16.     cout << "Elementele vec. sunt:" << endl;
  17.     for(i = 0;i<n;i++)
  18.     {
  19.         cout << v[i] << " ";
  20.         S+=v[i];
  21.     }
  22.     cout <<endl;
  23.     cout <<"Elementele vec. in ordine inversa sunt:"<<endl;
  24.     for(i=n-1;i>=0;i--)
  25.         cout << v[i] << " ";
  26.  
  27.     cout << endl;
  28.     cout << "S=" << S << endl;
  29.     med = S/n;
  30.     cout << "med="<<med;
  31.     return 0;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top