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 244549721 at 2011-07-19 15:49:27 on Problem 3673
#include<stdio.h>
#include<string.h>
main()
{
	char a[10],b[10];
	int i,m,n,j;
	long sum=0;
	scanf("%s %s",a,b);
	m=strlen(a);
	n=strlen(b);
	for(i=0;i<m;i++) a[i]=a[i]-'0';
    for(i=0;i<n;i++) b[i]=b[i]-'0';
	for(i=0;i<m;i++)
	{
		for(j=0;j<n;j++)
		{
			sum=sum+a[i]*b[j];
		}

	}
	printf("%ld\n",sum);

}

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