有高到低:ansible命令带入的变量 > cfg配置文件的变量 > 主项目的var变量 > role中的var变量 > role default 变量
如果仍有疑惑,这里也分享一个关于ansible一键部署、全面介绍的知识文档:https://support.websoft9.com/docs/ansible/zh/
云市场开源软件中心,从Wordpress、宝塔、SqlServer数据库到Gitlab、AWX等,一键部署,欢迎试用:https://market.cloud.tencent.com/products/28292。本地安装部署方案:https://github.com/websoft9
class Solution {
public:
int romanToInt(string s)
{
int ral = 0;
unordered_map<char, int>bp = { { 'I',1 },{ 'V', 5 },{ 'X', 10 },{ 'L' , 50 },{ 'C' , 100 },{ 'D' , 500 },{ 'M' , 1000 } };
int s_size = s.size();
for (int i = 0; i < s_size; i++)
{
int res = bp[s[i]];
if (i == s_size - 1 || bp[s[i + 1]] <= bp[s[i]]) ral += res;
else ral -= res;
}
return ral;
}