#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;}为什么最后的数就是读不出来
添加回答
举报
0/150
提交
取消