摘要:
题目说明: Write a function to find the longest common prefix string amongst an array of strings. 程序代码: #include using namespace std; string longestCommonPrefix1(vector& strs) { int nMinLength... 阅读全文
摘要:
题目说明: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 程序代码: #include using namespace std; //{'I','V','X','L','C','D','M','#','#'};... 阅读全文
摘要:
题目说明: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 程序代码: 思路是把数字拆成单独的部分,最后拼接起来 1. 拆分数字,求出每一位数字。 2. 把每位数字单独转换singleDigitToRoman成罗马数字,... 阅读全文