方法一:
容易理解的依次取余方法(用了一下反向迭代器)
class Solution {
public:
string intToRoman(int num) {
vector<vector<char>>table = {
{
'I','V'},{
'X','L'},{
'C','D'},{
'M'} };
vector<int>remainderList;
string Roman;
while (num != 0)
{
int remainder;
remainder = num % 10;
num = num / 10;
remainderList.push_back(remainder);
}
int digitalSize = remainderList.size();
for (auto iter = remainderList.