这题需要注意的是最后的进位

vector<int> plusOne(vector<int>& nums,int num)
{
add(nums, num);
}
void add(vector<int> &nums, int num)
{
int c = num;
for (auto it = nums.rbegin(); it != nums.rend(); it++)
{
*it += c;
*it = *it / ;
c = *it % ;
}
if (c > )
nums.insert(nums.begin(), );
}

最新文章

  1. Bootstrap Affix(附加导航(Affix)插件的用法)
  2. Winpcap安装,Cannot open include file &#39;pcap.h&#39;
  3. lua中常量的实现及表的深拷贝实现
  4. 免费素材下载:iOS 8 矢量 UI 素材套件
  5. springmvc+spring+mybatis分页查询实例版本3,添加条件检索
  6. Android Studio 学习 - 基本控件的使用;Intent初学
  7. PostgreSQL的 initdb 源代码分析之十三
  8. 隐藏win7盘符
  9. sql知识
  10. Hadoop 安装(1) CENTOS 安装与配置
  11. WPF之TabControl控件用法
  12. cookie记忆换肤功能实战Demo
  13. bzoj 4822: [Cqoi2017]老C的任务
  14. Monkey 生成报告方法
  15. 洛谷 4115 Qtree4——链分治
  16. MyBatis中resultType和resultMap的区别
  17. delphi中的 IntToHex()
  18. STM32F4的sct文件理解
  19. Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener. ...nested exception is java.lang.NoSuchMethodError:
  20. pgAdmin4 汉化

热门文章

  1. [SDOI2013]淘金 数位DP
  2. BZOJ1014:[JSOI2008]火星人prefix——题解
  3. HDOJ.1009 FatMouse' Trade (贪心)
  4. bzoj3810: [Coci2015]Stanovi(记忆化搜索)
  5. Human life FZU - 2295 最大权闭合子图(第一次遇到被教育了)
  6. [LeetCode] 6. ZigZag Conversion ☆☆☆
  7. RabbitMQ的使用总结
  8. 51Nod 1133 不重叠的线段 | 典型贪心
  9. jsp 内置对象二
  10. 【usaco-Earthquake, 2001 Open】 0-1分数规划 &amp; 最优比率生成树