#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define M 10
int main(int argc, const char * argv[])
{
//1:找出数组arr中值最大的数组成员,打印值和下标(比较和查找)
int i;
int j;
int max;
int t;
int a[M]={};
for (i=0; i<M; i++)
{
a[i]=rand()%100;
printf("%d ",a[i]);
}
for (i=0,max=a[0]; i<M; i++) {
if(a[i]>max)
{
max=a[i];
a[i]=a[i];
t=i;
}
}
printf("\n max = %d\n",max);
printf("\n t = %d\n",t);
return 0;
}