遍历数组
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n1[100]={0};
int n2[100]={0};
for(int i=0;i<100;i++){
scanf("%d\n",&n1[i]);
}
for(int i=0;i<100;i++)
{
n2[i]=n1[i];
}
for(int i=0;i<99;i++){
if(n1[i]>n1[i+1]){
int t=n1[i];
n1[i]=n1[i+1];
n1[i+1]=t;
}
}
cout<<n1[99]<<endl;
for(int i=0;i<100;i++){
if(n2[i]==n1[99])cout<<i+1<<endl;
}
return 0;
}