1. 更改單一個 module 的 compiler options
[Components]
PackageNamePkg/NameOneDxe/NameOneDxe.inf {
<BuildOptions>
MSFT:*_*_*_CC_FLAGS = /Od
}
public class Example_of_From_In_Let_Select { public static void Main(string[] args) { string names = "Mr.Adam,Mrs.Eva,Mr.Henry,MS.May"; var array = names.Split(','); var result = ( from name in array where (name.Substring(0, name.IndexOf('.')) == "Mr" ) let new_name = name + "<Male>" select new_name ); foreach(string x in result) Console.WriteLine(x); } }
Mr.Adam<Male>
Mr.Henry<Male>
// C++ Solution class Solution { public: int majorityElement(vector<int>& nums) { if (nums.size() == 1) return nums[0]; map <int, int> m; for (int i=0; i<nums.size(); i++) { if (m.find(nums[i]) == m.end() ) m[nums[i]] = 1; else { m[nums[i]]++; if (m[nums[i]] > nums.size()/2) return nums[i]; } } } };