POJ 2389
#include <iostream>
#include <algorithm>
#include <string>
#define MAXN 300
using namespace std; int tem[MAXN]; void big_int_mul(string a,string b,string & ans); int main()
{
//freopen("acm.acm","r",stdin);
string a;
string b;
string ans;
cin>>a>>b;
big_int_mul(a,b,ans);
cout<<ans<<endl;
} void big_int_mul(string a,string b,string & ans)
{
int len_1 = a.length();
int len_2 = b.length();
int len = a.length() + b.length();
int i;
int j;
for(i = ; i < len_1; ++ i)
{
for(j = ; j < len_2; ++ j)
{
tem[i+j+] += (a[i]-'')*(b[j] - '');
}
}
for(i = len - ; i > ; -- i)
{
if(tem[i] >= )
{
tem[i-] += tem[i]/;
tem[i] %= ;
}
}
j = ;
while(tem[j] == )
{
++ j;
} for(; j < len; ++ j)
{
ans += char(tem[j]+'');
}
}
POJ 2389的更多相关文章
- POJ 2389 Bull Math(水~Java -大数相乘)
题目链接:http://poj.org/problem?id=2389 题目大意: 大数相乘. 解题思路: java BigInteger类解决 o.0 AC Code: import java.ma ...
- poj 2389.Bull Math 解题报告
题目链接:http://poj.org/problem?id=2389 题目意思:就是大整数乘法. 题目中说每个整数不超过 40 位,是错的!!!要开大点,这里我开到100. 其实大整数乘法还是第一次 ...
- qau-国庆七天乐——B
B - Bull Math Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Sub ...
- Poj OpenJudge 百练 2389 Bull Math
1.Link: http://poj.org/problem?id=2389 http://bailian.openjudge.cn/practice/2389/ 2.Content: Bull Ma ...
- POJ 题目分类(转载)
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965 ...
- (转)POJ题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- poj分类
初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. ( ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
随机推荐
- Linux IPC之共享内存
System V共享内存机制: shmget shmat shmdt shmctl 原理及实现: system V IPC机制下的共享内存本质是一段特殊的内存区域,进程间需要共享的数据被放在该共 ...
- VMware + LInux + Xshell 连接环境设置(心得体会)
准备好VMware软件,和Linux 和xshell三款软件,下载和安装好,这里VMware是十二,Linux是CentOs 6 ,xshell是5 其实没有什么区别只要版本兼容就行,我们就可以实现远 ...
- HDU 2161 Primes (素数筛选法)
题意:输入一个数判断是不是素数,并规定2不是素数. 析:一看就很简单吧,用素数筛选法,注意的是结束条件是n<0,一开始被坑了... 不说了,直接上代码: #include <iostrea ...
- swagger core 和 swagger ui 如何关联【窥探】
几个片段: package io.swagger.jaxrs.listing; import io.swagger.annotations.ApiOperation; import org.apach ...
- 笔记:CSS常用中文字体英文名称对照表
* 分类排序:中文名+英文名+Unicode+Unicode 2 Windows平台新细明体 PMingLiU \65B0\7EC6\660E\4F53 新细明体细明体 MingLiU \7EC6\6 ...
- Oracle EBS - Setup: 配置文件Profile
http://blog.csdn.net/lfl6848433/article/details/8696939 Oracle EBS - Setup: 配置文件Profile 1.诊断Diagnost ...
- delphi 连接oracle对接代码
selectt4.vclen60 as pat_d_codename,t4.vclen60 as pat_sexname,t1.pat_sex,t1.pat_d_code,t1.pat_in_no,t ...
- Delphi事件的广播 转
http://blog.sina.com.cn/s/blog_44fa172f0102wgs2.html 原文地址:Delphi事件的广播 转作者:MondaySoftware 明天就是五一节了,辛苦 ...
- 实现EventHandler的监测
的监测", "category":"", "tags":"", "publish":&qu ...
- Elasticsearch 核心插件Kibana 本地文件包含漏洞分析(CVE-2018-17246)
不久前Elasticsearch发布了最新安全公告, Elasticsearch Kibana 6.4.3之前版本和5.6.13之前版本中的Console插件存在严重的本地文件包含漏洞可导致拒绝服务攻 ...