自己写的:
            
            
              cpp
              
              
            
          
          #include <unordered_map>
class Solution {
public:
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     *
     * 
     * @param nums int整型vector 
     * @return int整型vector
     */
    vector<int> FindNumsAppearOnce(vector<int>& nums) {
        // write code here
        map<int, int> hash;
        vector<int> res;
        for(int i = 0;i < nums.size(); i++){
            hash[nums[i]]++;
        }
        auto it = hash.begin();
        while(it != hash.end()){
            if(it->second == 1)
                res.push_back(it->first);
            it++; // 粗心,容易忘记
        }
        return res;
    }
};
        模板的:
我用的是map,模板用的unordered_map。
模板最后对两个数进行排序。