POJ 3673 Cow Multiplication G++
来源:互联网 发布:传奇3数据库修改 编辑:程序博客网 时间:2024/05/21 10:41
一美女学霸定义了一种新的乘法,比如123*45=1x4+1x5+2x4+2x5+3x4+3x5,现在给出两个被乘数a,b,输出a*b
Input
两个整数a,b(1<=a,b<=1000000000)
Output
输出a*b
#include <iostream>using namespace std;//两种都能通过 int main(){int a,b;//第一种 cin>>a>>b;int x=0;int y=a;int jg=0;while(y){x=y%10;y=y/10;int m=0;int n=b;while(n){m=n%10;n=n/10;jg=jg+x*m;}}cout<<jg;/* int a,b;//第二种 cin>>a>>b;int x=0;int y=a;int jg=0;while(y){x=y%10;y=y/10;jg=jg+x;}int he=0;x=0;y=b;while(y){x=y%10;y=y/10;he=he+x;}cout<<jg*he;*/return 0;}
0 0
- POJ 3673 Cow Multiplication G++
- poj 3673 Cow Multiplication
- POJ 3673 Cow Multiplication
- POJ 3673 Cow Multiplication
- POJ - 3673 Cow Multiplication
- POJ 3673:Cow Multiplication
- POJ 3673 Cow Multiplication
- poj 3673 Cow Multiplication(水题)
- POJ 3673 Cow Multiplication(水~)
- 文章标题 POJ 3673 : Cow Multiplication (水)
- Cow Multiplication
- POJ 3193 Cow Phrasebook G++
- POJ 3176 Cow Bowling G++
- POJ3673----Cow Multiplication
- poj3673 Cow Multiplication
- POJ-3673 cow multiplition
- POJ 1060/ ZOJ 1026 : Modular Multiplication of Polynomials - f(x)g(x) mod h(x)
- POJ 3318 Matrix Multiplication
- bzoj1001: [BeiJing2006]狼抓兔子
- 再理解闭包(Closure)
- [Java]正则表达式
- 建造者模式
- 第五届蓝桥杯JavaA组第一题
- POJ 3673 Cow Multiplication G++
- C语言标准库函数qsort那点小事
- DPDK-L3fwd测试
- 第五届蓝桥杯JavaA组第二题
- .Net程序员学用Oracle系列(14):子查询、集合查询
- 适配器模式
- Spring Boot学习笔记-从Hello World开始 (一)
- notes Hunspell Tutorial
- jdbc进行简单的增删改查