这种类似大整数的处理的问题还是比较常见的,这道题应该是非常简单的版本。
题目的要求是这样的,输入的vector靠前的位置是数字的高位,因此应该先求出长度,然后从后面往前算。维护一个变量保存进位,这我就不说了。结果的vector怎么办呢?因为最后有可能有个总的进位,比如999加1,结果的vector会比输入的多出一位,因此结果还是从前往后存简单一些。最后如果有进位,就多push_back一个1,然...
分类:
其他好文 时间:
2014-05-14 00:31:48
阅读次数:
312
http://blog.sina.com.cn/s/blog_7c35df9b0100vtud.html
分类:
编程语言 时间:
2014-05-13 19:53:19
阅读次数:
255
简单总结下,我们从C++的内置数组讲到标准库提供的vector,
最后谈到C++11新增的array, 数组这个最基本的数据结构在C++中终于有了完整的支持。
分类:
其他好文 时间:
2014-05-13 18:04:29
阅读次数:
263
/*
ID:kevin_s1
PROG:dualpal
LANG:C++
*/
#include
#include
#include
#include
#include
using namespace std;
int N,S;
vector result;
bool isPalindromic(string num){
bool flag = true;
int len =...
分类:
其他好文 时间:
2014-05-13 06:10:09
阅读次数:
312
OneofthefilesthattheaverageUnixsysadminrarelylooksat,almostneverchangesandyetdependsoneverytimeheorsherebootsasystemisthe/etc/inittabfile.Thismodestlittlefilecontrolswhathappenswheneverasystemisrebootedorforcedtochangerunlevels.Let‘stakealookattheconfigurat..
分类:
系统相关 时间:
2014-05-13 04:47:00
阅读次数:
612
集合基础知识数组:长度固定,可存基本数据和对象。集合:只能放对象,不固定。容器也有共性,不断抽取成一个体系,集合框架。参阅顶层创建底层。顶层是collection。collection里有两个常见的接口,List和Set。常见集合有Arraylist,linkedlist,vector,hashSetTreeSet.为什么..
分类:
其他好文 时间:
2014-05-13 03:35:07
阅读次数:
371
ext版本:4.2需求:在数据record绑定到form的时候,Ext会触发field的change事件和validate事件。以至于,新建的空表单界面,会出现验证不通过的样式,如下图:解决思路:在formloadRecord之前,禁止field的change()事件,loadRecord之后,开启field的change()事件。loadRecord..
分类:
其他好文 时间:
2014-05-13 03:33:03
阅读次数:
340
7.1 操作系统接口
Os模块提供主要许多与操作系统交互的函数。
>>> import os
>>> os.getcwd() # Return the current working directory
’C:\\Python31’
>>> os.chdir(’/server/accesslogs’) # Change current working directory
>>> ...
分类:
编程语言 时间:
2014-05-12 23:08:03
阅读次数:
356
先执行:rubyscript/generatemigrationadd_change_flag_to_userschange_flag:Boolean生成时间序列文件:db/migrate/20131016034104_add_changeflag_to_users.rb内容:classAddchangeflagToUsers<ActiveRecord::Migrationdefself.upadd_column:users,:change_flag,:booleanen..
分类:
其他好文 时间:
2014-05-12 03:10:04
阅读次数:
368