poj3673 Cow Multiplication
来源:互联网 发布:js计算一个整数的阶乘 编辑:程序博客网 时间:2024/05/19 10:54
题意:定义了一个新的乘法方式: 123*45 =1*4 + 1*5 + 2*4 + 2*5 + 3*4 + 3*5 = 54
思路:循环求出每一位数即可
#include<cstdio>#include<iostream>#include<cstring>using namespace std;int main(){int a,b,i=0,j=0,ans=0;int x[15],y[15];cin>>a>>b;while(a>0){ x[i++]=a%10; a=a/10;}while(b>0){ y[j++]=b%10; b=b/10;}for(int k=0;k<i;k++) for(int l=0;l<j;l++) ans+=x[k]*y[l];cout<<ans<<endl;}
0 0
- POJ3673----Cow Multiplication
- poj3673 Cow Multiplication
- Cow Multiplication
- poj3673
- poj3673
- poj3673
- poj3673
- 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 G++
- poj 3673 Cow Multiplication(水题)
- POJ 3673 Cow Multiplication(水~)
- 文章标题 POJ 3673 : Cow Multiplication (水)
- 北大ACM poj3673
- C# 第四章上机练习1
- getline();和reserve();
- HDU 1016 Prime Ring Problem
- 用 Flask 来写个轻博客 (3) — (M)VC_连接 MySQL 和 SQLAlchemy
- java环境变量配置详解
- poj3673 Cow Multiplication
- php源码之路第六章第一节 (内存管理概述)
- OJ_0039.字符个数
- JS特效 xmind思维导图
- 嵌入式数据库sqlites编程
- java与c语言
- 洛谷 P1760 通天之汉诺塔
- C语言-数据结构-哈夫曼编码-Huffman-源代码
- Android开发学习之路-SnackBar使用心得