Advertisement
STANAANDREY

21c

Dec 10th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.   long long n,E=0,i=1,p=1;
  9.  
  10.   cout<<"n=";cin>>n;
  11.  
  12.   while (i<=n)
  13.   {
  14.       p*=i;
  15.       E+=p;
  16.       i++;
  17.   }
  18.     cout<<"E="<<E;
  19.  
  20. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement