#include
using namespace std;
int* Max(int* a, int*b, int* c)
{
int *tmp = *a>*b ? a:b;
return *tmp>*c ? tmp:c;
}
int* Min(int* a, int*b, int* c)
{
int *tmp = *a<*b ? a:b;
return *tmp<*c ? tmp:c;
}
int main()
{
int *a = new int(0);
int *b = new int(0);
int *c = new int(0);
cin>>*a>>*b>>*c;
cout<<"Max: "<<*Max(a,b,c)<
delete a;
delete b;
delete c;
return 0;
}
#include
#include
#define MAX 3
int main(int argc,char **argv)
{
int *num;
int max,min,i;
num=calloc(MAX,sizeof(int));
for(i=0;i
scanf("%d",num+i);
if(i==0)
max=min=*(num+i);
else{
if(min>*(num+i))
min=*(num+i);
if(max<*(num+i))
max=*(num+i);
}
}
free(num);
printf("the max num is %d\nthe min num is %d\n",max,min);
return 0;
}