加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

UVA Product(大数乘法)

发布时间:2020-12-14 02:54:38 所属栏目:大数据 来源:网络整理
导读:Product Time Limit: 3000 MS????? Memory Limit: 0 KB????? 64bit IO Format: %lld %llu Submit ? Status Description ?Product ? The Problem The problem is to multiply two integers X,Y. ( 0=X,Y10 250 ) The Input The input will consist of a set o
Product
Time Limit:3000MS?????Memory Limit:0KB?????64bit IO Format:%lld & %llu
Submit? Status

Description


?Product?

The Problem

The problem is to multiply two integers X,Y. (0<=X,Y<10250)

The Input

The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.

The Output

For each input pair of lines the output line should consist one integer the product.

Sample Input

12
12
2
222222222222222222222222

Sample Output

144
444444444444444444444444






#include<iostream>
<algorithm>
<stdio.h>
<string.h>
<stdlib.h>

using namespace std;

int main()
{
    char str1[3000],str2];
    int d6000int len1,len2;
    while(scanf("%s")!=EOF)
    {
        memset(c0sizeof));
        memset(d(f));
        scanf);
        len1=strlen(str1);
        len2(str2);
        if(len1<=len2)
        {
            len=len2;
        }
        else
        =len1}
        w;
        e;
        for(int i=; i<len++)
        {
            (len1-1>=)
            {
                d[i]=str1[len1]-'0';
                len1--;
            }
            else d]=;
            (len2{
                f]=str2[len2;
                len2else f<wint j; j<e++)
            {
                c+j]=c]+d]*f[j];
            }
        <4000++) //i=w+e;
        ]>=10[i+1]+=c]/;
                c]%;
            }
        int flag--) (flag||c])
            {
                flag1;
                printf"%d"]);
            =={
            printf"0");
        }
        printf"n");


    }
    return ;
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读