seo工具是什么/泰安seo推广
指针变量作为函数的参数
对输入的两个整数按大小顺序输出。用函数处理,用指针类型的数据作为函数参数。
// yangbocsu 2021.05.23 民主楼#include<stdio.h>
void swap(int *p1, int *p2);
int a, b;
int main(void)
{int *p1 = &a, *p2 = &b;scanf("%d %d",&a,&b);if(a < b)swap(p1,p2);printf("max = %d min = %d",*p1,*p2 );return 0;
}void swap(int *p1, int *p2)
{int temp;temp = *p1;*p1 = *p2;*p2 = temp;
}