#include "stdafx.h"
#include"windows.h"
#include <iostream>
int main()
{
int a = 0,b = 0;
if(std::cin>> a ){
int cnt = 1;
while(std::cin >> b ){
if( b == a )
++cnt;
else{
std::cout<< a <<"occurs"
<< cnt <<"times"<< std::endl;
a=b;
cnt=1;
}
}
std::cout<<a<<"occurs"
<< cnt <<"times"<<std::endl;
}
system("pause");
return 0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/74439.html
標籤:基礎類
上一篇:求高手解決矩陣方程
