课堂练习
#include<iostream>
using namespace std;
int Largest(int list[], int length)
{
int i,max=list[0];
for(i = 0;i < length ;i ++ )
{
if(list[i] > max)
{
max=list[i];
}
}
return max;
}
void main()
{
int length=5,*list;
list=new int[length];
for(int i=0;i<length;i++)
{
cout<<"intput"<<i+1<<" ";
cin>>list[i];
}
cout<<"max "<<Largest(list,length)<<endl;
};