博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POJ 3673:Cow Multiplication
阅读量:7015 次
发布时间:2019-06-28

本文共 1025 字,大约阅读时间需要 3 分钟。

Cow Multiplication
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 12210   Accepted: 8509

Description

Bessie is tired of multiplying pairs of numbers the usual way, so she invented her own style of multiplication. In her style, A*B is equal to the sum of all possible pairwise products between the digits of A andB. For example, the product 123*45 is equal to 1*4 + 1*5 + 2*4 + 2*5 + 3*4 + 3*5 = 54. Given two integers A and B (1 ≤ A, B ≤ 1,000,000,000), determine A*B in Bessie's style of multiplication.

Input

* Line 1: Two space-separated integers: A and B.

Output

* Line 1: A single line that is the A*B in Bessie's style of multiplication.

Sample Input

123 45

Sample Output

54

还是水题。。。字符串按位乘,再相加。

代码:

#include 
#include
#include
#include
#include
using namespace std;int main(){ string m,n; cin>>m>>n; int i,j,result=0; for(i=0;i

版权声明:本文为博主原创文章,未经博主允许不得转载。

转载于:https://www.cnblogs.com/lightspeedsmallson/p/4785857.html

你可能感兴趣的文章
前端文摘:Web 开发模式演变历史和趋势
查看>>
win7的优化-1:隐藏我的电脑导航栏里的收藏等项目
查看>>
Consequence of Point-by-Point Bounds
查看>>
c# 封装的7zip压缩 (全源码,不含任何类库)
查看>>
三、OPENERP 中的对象关系类型
查看>>
PHP-CGI 进程 CPU 100% 与 file_get_contents 函数的关系
查看>>
流行时尚!21例创新的侧边栏菜单网页设计作品
查看>>
android jni编译时Android.mk文件的规范说明
查看>>
paip.enhes efis 自动获取文件的中文编码
查看>>
[物理学与PDEs]书中出现的符号及其意义汇总
查看>>
centos+apache+mod_ssl
查看>>
Python:Hello World级别的SimpleDb
查看>>
C#:列表视图操作类
查看>>
【struts2】action中使用通配符
查看>>
ThinkPad L421 如何进入BIOS?(已解决)
查看>>
[Android UI] ActionBar 自定义属性
查看>>
sqlite
查看>>
打哈欠真的会传染吗?
查看>>
osgi实战学习之路:5.生命周期及利用命令、装饰者模式实现基于socket交互Bundle命令demo...
查看>>
【Java】String,StringBuffer与StringBuilder的区别??
查看>>