25 lines
320 B
C++
25 lines
320 B
C++
#include<iostream>
|
|
using namespace std;
|
|
int main(){
|
|
int a[5]={87,99,3,12,1};
|
|
int max=a[0];
|
|
int * ptr_x;
|
|
ptr_x=a;
|
|
|
|
|
|
for(int i=1;i<5;i++){
|
|
|
|
if(*ptr_x > max){
|
|
max = *ptr_x;
|
|
}
|
|
ptr_x++;
|
|
cout<<ptr_x<<endl;
|
|
|
|
}
|
|
|
|
cout<<max<<" ";
|
|
|
|
return 0;
|
|
}
|
|
|