Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x,y,n;
  8.     cout << "x,y,n:\n";
  9.     cin >> x >> y >> n;
  10.     int p=1,s=0,res=1;
  11.     __asm
  12.     {
  13.         xor ecx,ecx
  14. for1:
  15.         inc ecx
  16.         mov ebx,ecx
  17.         xor ecx,ecx
  18.         mov s,0
  19. for2:
  20.         inc ecx
  21.         mov edx,ecx
  22.         xor ecx,ecx
  23.         mov p,1
  24. for3:
  25.         inc ecx
  26.         mov eax,x
  27.         imul eax,y
  28.         imul eax,p
  29.         mov p,eax
  30.         cmp ecx,edx
  31.         jne for3
  32.         mov eax,s
  33.         add eax,p
  34.         mov s,eax
  35.         mov ecx,edx
  36.         cmp ecx,ebx
  37.         jne for2
  38.         mov eax,res
  39.         imul eax,s
  40.         mov res,eax
  41.         mov ecx,ebx
  42.         cmp ecx,n
  43.         jne for1
  44.     }
  45.     cout << res;
  46.     res=p=1;s=0; //4368
  47.     for(int i=1;i<=n;++i)
  48.     {
  49.         s=0;
  50.         for(int j=1;j<=i;++j)
  51.         {
  52.             p=1;
  53.             for(int m=1;m<=j;++m)
  54.                 p*=x*y;
  55.             s+=p;
  56.         }
  57.         res*=s;
  58.     }
  59.     cout << '\n' << res;
  60.     return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement