镇乃天子
This commit is contained in:
17
666/最大值3.cpp
Normal file
17
666/最大值3.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a[5]={9,99,999,9999,99999};
|
||||
int *ptr_x;
|
||||
int max;
|
||||
ptr_x=a;
|
||||
max=*ptr_x;
|
||||
for(int i=1;i<=5;i++){
|
||||
if(*ptr_x>max)
|
||||
max=*ptr_x;
|
||||
ptr_x++;
|
||||
}
|
||||
cout<<max<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user