CodePudding user response:
VectorCout & lt;
});
CodePudding user response:
Look at this time, a little taste of dlutCodePudding user response:
int main () {
int n;
Cin & gt;> n;//enter data into a total of how much
VectorVec.//save data
Int number;
//from the keyboard input number n
While (n -) {
Cin & gt;> Number;
Vec. Push_back (number);
}
Unordered_map & lt; Int, int> Num_count;
//statistics the number of occurrences of the
For (auto & amp; It: vec) {
{if (num_count. Count (it))
Num_count [it] + +;
}
The else {
Num_count. Insert (pair(it, 1));
}
}
//output
For (auto & amp; It: num_count) {
If (it. The second & gt; 2) {
Cout & lt;}
}
}
Example: input the number 7, including 22 appeared 3 times,