#include<iostream>
using namespace std;
int main()
{
int cur = 0, val = 0;
if (cin >> cur){
int cnt = 1;
while (cin >> val){
if (val == cur)
++cnt;
else {
cout << cur << " occurs "
<< cnt << " times" << endl;
cur = val;
cnt = 1;
}
}
cout << cur << " occurs "
<< cnt << " times" << endl;
}
return 0;
}
为什么最后的数就是读不出来
慕粉3308745
相关分类