Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int a[100];
- int i,j,n,max=0,m,index;
- cout<<"Please Enter the elements of your aray: "; cin>>n;
- for (i=0;i<=n;i++){
- cout<< "a["<<i<<"] : ";
- cin>>a[i] ;
- }
- for(i=0;i<=n;i++){
- int k=0;
- for (j=0;j<n-1;j++){
- if(a[i] == a[j+1]){
- k=k+1;
- }
- }
- if(max<k){
- max = k;
- m=a[i];
- index = i;
- }
- }
- cout<<"Chisloto koeto se povtarq nai-mnogo e: "<<max<<endl;
- cout<<"Zapochva ot index: "<<index<<endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement