1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int n=0, num, i=0, p, temp, ii=0;
int max[10]={1, 4, 9, 10, 9, 7, 8, 7, 4, 3};
for(i; i<10; i++){
for(n=i+1; n<10; n++){
if(max[i]==max[n]){
cout<<"Array Element of Duplicate Number: "<<n<<" ";
cout<<" "<<endl;
cout<<" "<<endl;
cout<<"Duplicate Number: "<<max[i]<<" ";
cout<<" "<<endl;
cout<<" "<<endl;
/* for(n=0; n<10; n++){
if(n=!i){
cout<<max[n]<<" ";
}*/
// }
}
}
}
cout<<" "<<endl;
cout<<" "<<endl;
return 0;
}
|