1
0
forked from newde/homework
Files
homework/最大值指针.cpp
2026-03-14 05:52:32 -04:00

19 lines
342 B
C++

#include<iostream>
using namespace std;
int main(){
int arr[10]={11,99,21,16,313,25,8,43,116,2};
int * ptr_a;
ptr_a=arr;
for (int i=1;i<10;i++){
if(*ptr_a<arr[i])
*ptr_a=arr[i];
}
cout << "最大值是:"<<*ptr_a<<endl;
return 0;
}