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

水啊

Posted by Michael112233 at 2016-05-25 13:42:57 on Problem 3673
#include<cstdio>

int main()
{
	int x,y,lena=0,lenb=0,i,j,ans=0,a[100],b[100];
	scanf("%d%d",&x,&y);
	while(x)
	{
		lena++;
		a[lena]=x%10;
		x=x/10;
	}
	while(y)
	{
		lenb++;
		b[lenb]=y%10;
		y=y/10;
	}
	for(i=1;i<=lena;i++)
	    for(j=1;j<=lenb;j++)
	        ans+=a[i]*b[j];
	printf("%d\n",ans);
}

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