实验8-1-1 利用指针找最大值 (10 分)
#include <stdio.h> void findmax(int *px, int *py, int *pmax); int main() { int max, x, y; scanf("%d %d", &x, &y); findmax(&x, &y, &max); printf("%d\n", max); system("pause"); return 0; } /* 你的代码将被嵌在这里 */ void findmax(int *px, int *py, int *pmax) { if (*px <= *py) *pmax = *py; else *pmax = *px; return *pmax; }

浙公网安备 33010602011771号