Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,y,n;
- cout << "x,y,n:\n";
- cin >> x >> y >> n;
- int p=1,s=0,res=1;
- __asm
- {
- xor ecx,ecx
- for1:
- inc ecx
- mov ebx,ecx
- xor ecx,ecx
- mov s,0
- for2:
- inc ecx
- mov edx,ecx
- xor ecx,ecx
- mov p,1
- for3:
- inc ecx
- mov eax,x
- imul eax,y
- imul eax,p
- mov p,eax
- cmp ecx,edx
- jne for3
- mov eax,s
- add eax,p
- mov s,eax
- mov ecx,edx
- cmp ecx,ebx
- jne for2
- mov eax,res
- imul eax,s
- mov res,eax
- mov ecx,ebx
- cmp ecx,n
- jne for1
- }
- cout << res;
- res=p=1;s=0; //4368
- for(int i=1;i<=n;++i)
- {
- s=0;
- for(int j=1;j<=i;++j)
- {
- p=1;
- for(int m=1;m<=j;++m)
- p*=x*y;
- s+=p;
- }
- res*=s;
- }
- cout << '\n' << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement