#include<iostream>
using namespace std;
int main()
{
int a[5];
for(int i=0; i<5; i++)
{
cin>>a[i];
}
int *p,minimum=a[0],maximum=a[0];
for(int i=0;i<5;i++)
{
p=&a[i];
if(*p<minimum)
minimum=*p;
else if (*p>maximum)
maximum=*p;
}
cout<<"minimum : "<<minimum<<" maximum : "<<maximum<<endl;
return 0;
}
No comments:
Post a Comment