poj 3673
来源:互联网 发布:五毛钱特效制作软件 编辑:程序博客网 时间:2024/06/08 17:26
小水一道
有两个数 A and B (1 ≤ A, B ≤ 1,000,000,000), 作如下运算,例如:123*45 is equal to 1*4 + 1*5 + 2*4 + 2*5 + 3*4 + 3*5 = 54.
#include <cstdio>#include <iostream>#include <string.h>#include <stdlib.h>#include <fstream>#include <math.h>#include <algorithm>#define INF 0x3f3f3f3fusing namespace std;char a[11],b[11];int sum;int main(){//freopen ("input.txt","r",stdin);scanf("%s %s",a,b);sum=0;int l1=strlen(a),l2=strlen(b);for(int i=0;i<l1;i++)for(int j=0;j<l2;j++)sum+=(a[i]-'0')*(b[j]-'0');cout<<sum<<endl;return 0;}
0 0
- poj 3673
- POJ 3673
- poj 3673 Cow Multiplication
- POJ 3673 Cow Multiplication
- POJ 3673 Cow Multiplication
- POJ - 3673 Cow Multiplication
- POJ 3673 解题报告
- POJ 3673:Cow Multiplication
- POJ 3673 Cow Multiplication
- POJ 3673(水题)
- POJ-3673 cow multiplition
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- Java类的封装、多态和继承
- Java中的String对象是不可变的吗?(jdk7u4测试)
- C语言的谜题
- 使用FTP(IOS FTP客户端开发教程)
- Google Java Style 中文版
- poj 3673
- Python 函数 参数 形式 Default Argument Keyword Arguments Formal Arguments
- 1489 求二叉树的先序遍历
- 算法学习系列之初章---R-Tree
- Python:Windows7 (64位)系统下安装Scrapy详细教程
- pdksh-5.2.14 install pdksh conflicts with ksh-20100621-16.el6.x86_64
- ARP欺骗、DNS欺骗,与数据流重定向
- /etc/fstab
- HTTP简史