运行 ❯
建立您
自己的
网站
×
更改方向
更改主题,深色/浅色
前往 Spaces
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> numbers = {1, 2, 7, 5, 3, 5, 9, 2, 5}; int amount = count(numbers.begin(), numbers.end(), 5); cout << "The number 5 appears " << amount << " times"; return 0; }
数字5出现了3次