rengetsu

Proced_3_Pratyb_3.02

Mar 13th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,a[11],sum=0;
  6. cin>>n;
  7. for(int i=0;i<n;i++)
  8. {cin>>a[i];if(i==0 || i==n-1){sum+=a[i];}}
  9. cout<<sum<<endl;
  10. return 0;
  11. }
Add Comment
Please, Sign In to add comment