摘要: Given a number represented as an array of digits, plus one to the number.class Solution {public: vector plusOne(vector &digits) { // Start typing your C/C++ solution below // DO NOT write int main() function bool carry=true; vector ret; ret.resize(digits.size())... 阅读全文
posted @ 2013-09-03 16:53 懒猫欣 阅读(190) 评论(0) 推荐(0)
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: string intToRoman(int num) { string ret; while(num>999){ ret.append("M"); num-=1000; } if(num>899){ ret.ap... 阅读全文
posted @ 2013-09-03 00:24 懒猫欣 阅读(174) 评论(0) 推荐(0)