C++ PTA 求最大值最小值
用指针作函数参数,编程序求一维数组中的最大和最小的元素值。
函数接口定义:
void maxmin(int arr[ ],int *pt1,int *pt2,int n);
其中 arr、 pt1、pt2、n都是用户传入的参数,n为元素个数。函数求指针arr所指向的一维数组中的最大和最小的元素值,并将最大值和最小值存入指针pt1和pt2所指的存储单元中。
裁判测试程序样例:
#include<stdio.h>
#define N 10
void maxmin(int arr