CSUOJ_1002
/*
* Title : A+B(III)
* Data : 2016/11/09
* Author : Andrew
*/ #include <iostream>
#include <cstring> int main() {
std::string str1, str2;
while (std::cin >> str1 >> str2) {
int a[], b[], len;
memset(a, , sizeof(a));
memset(b, , sizeof(b));
if (str1 == "" && str2 == "") {
break;
}
a[] = str1.length();
b[] = str2.length();
for (int i = ; i <= a[]; ++i)
a[i] = str1[a[] - i] - '';
for (int j = ; j <= b[]; ++j)
b[j] = str2[b[] - j] - '';
len = (a[] > b[] ? a[] : b[]);
for (int i = ; i <= len; i++) {
a[i] += b[i];
a[i + ] += a[i] / ;
a[i] %= ;
}
len++;
while ((a[len] == ) && (len > ))
len--;
for (int i = len; i >= ; i--)
std::cout << a[i];
std::cout << std::endl;
}
return ;
}
CSUOJ_1002的更多相关文章
- python 脚本开发实战-当当亚马逊图书采集器转淘宝数据包
开发环境python2.7.9 os:win-xp exe打包工具pyinstaller 界面tkinter ============================================= ...
随机推荐
- LDAP的Schema
Schema是LDAP的一个重要组成部分,类似于数据库的模式定义,LDAP的Schema定义了LDAP目录所应遵循的结构和规则,比如一个 objectclass会有哪些属性,这些属性又是什么结构等等, ...
- 配置java环境 ,安装Android Studio...(ps:用eclipse也不错,但as是趋势 自己凭爱好选择)
to:青科大可爱的学弟学妹: 配置java环境 step1:下jdk 直接打开链接即可(ps:复制链接到迅雷下载更快哦) 64位的:http://download.oracle.com/otn-pub ...
- nginx跨域配置
假设前端页面的地址为: 192.168.1.1/arcgis40/index.html 页面物理路径为: X:\nginx-1.9.15\html\arcgis40 那么请求服务时,当ajax代码如下 ...
- 该字符串未被识别为有效的 DateTime
开发语言C#,System.Data.SQLite.dll驱动. SQLserver数据库转换为SQLite数据库时,日期类型默认转为DATETIME. 执行查询SQL语句,数据为空(查询不到数据时) ...
- Mount DVD on CentOS
Mount DVD on CentOS need to mount CD/DVD on CentOS Temporarily or Permanently? Here’s the Process Us ...
- OSI Model
- JAG Summer 2012 Day 4 C Connect
状压dp,由于枚举两维状态会GG,所以只枚举当前位置前m个的状态,就是这个样子大概= =: 呆马: #include <iostream> #include <cstdio> ...
- HDU 4292:Food(最大流)
http://acm.hdu.edu.cn/showproblem.php?pid=4292 题意:和奶牛一题差不多,只不过每种食物可以有多种. 思路:因为食物多种,所以源点和汇点的容量要改下.还有D ...
- spring3种配置的比较
引用自:Spring 3.x 企业应用开发实战
- js定义对象的几种容易犯的错误
//js定义对象的几种容易犯的错误function Person() { getName = function (){ console.info(1); }; return this;}//Perso ...