/////////////////////////////////////////////////////////
//数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。
//例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}。
//由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2。
#include
using namespace std;
int Grial(int a[],int n)
{
if(n==0)return -1;
int flog = n/2;
int i = 0;
int count = 0;
for(;i
flog)return a[i]; else count = 0; } return 0; } int main() { int a[]={1,1,1,12,3}; cout<