#include<iostream>
#include<cstring>
#include<algorithm>
#include<ctime>
#define MAX 8
using namespace std;
int main()
{
int a[MAX]={1,5,9,6,3,1,4,6};
for(int i=0;i<MAX;i++)
cout<<a[i]<<" ";
cout<<endl;
/*
顺序查找
int k,j,i;
bool find;
int num;
while(1){
cin>>num;
find =0;
for(i=0;i<MAX;i++){
if(a[i]==num){
cout<<i<<" ";
find =1;
}
}
if(!find) cout<<"FAIL"<<endl;
}
*/
/*
冒泡排序
int temp,i,j;
for(i=MAX-1;i>=1;i--)
{
for(j=0;j<i;j++)
{
if(a[j]>a[j+1]){
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
*/
/*
数值排序
int i,k,j,tmp;
for(i=0;i<MAX;i++)
{
k=i;
for(j=i+1;j<MAX;j++)
{
if(a[k]>a[j])
k=j;
}
if(k !=i)
{
tmp=a[i];
a[i]=a[k];
a[k]=tmp;
}
}
*/
for(int i=0;i<MAX;i++)
{
cout<<a[i]<<" ";
}
system("pause") ;
return 0;
}