Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

assembly

Posted by azma at 2009-05-18 12:58:25 on Problem 3673
#include <iostream>
using namespace std;
int main(void){
	int a,b,i,r;
	cin>>a>>b;
	__asm{
		mov r,0;
		l2:;
		cmp a,0;
		jz l3;		
		mov eax,b;
		mov i,eax;
		l1:
		mov edx,0;
		mov eax,a;
		mov ebx,10;
		div ebx;
		mov ecx,edx
		mov edx,0;
		mov eax,i;
		mov ebx,10;
		div ebx;
		mov eax,edx;
		mul ecx;
		add r,eax;
		mov edx,0;
		mov eax,i;
		mov ebx,10;
		div ebx;
		mov i,eax;
		cmp i,0;
		jnz l1;
		mov edx,0;
		mov eax,a;
		mov ebx,10;
		div ebx;
		mov a,eax;
		jmp l2;
		l3:
	}
	cout<<r;
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator