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 100610111 at 2015-03-24 19:19:50 on Problem 3673
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
    char a[10],b[10];
    long sum=0;
    int m,n;
    cin>>a>>b;
    m=strlen(a);
    n=strlen(b);
    for(int i=0;i<m;i++)
        a[i]=a[i]-'0';
    for(int j=0;j<n;j++)
        b[j]=b[j]-'0';

    for(int k=0;k<m;k++)
        for(int j=0;j<n;j++)
            sum+=a[k]*b[j];
    cout<<sum<<endl;
    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