#include<stdio.h> int main() { void swap(int *p,int *q); int a,b,*p1,*p2; scanf( "%d%d",&a,&b);
p1=&a;p2=&b; if(a<b) swap(p1,p2); printf("\n%d,%d\n",a,b); printf("\n"); } void swap(int *p,int *q) { int temp; temp=*p; *p=*q; *q=temp; }
#include<stdio.h> int main() { void swap(int *p,int *q); int a,b,*p1,*p2; scanf( "%d%d",&a,&b);
p1=&a;p2=&b; if(a<b) swap(p1,p2); printf("\n%d,%d\n",a,b); printf("\n"); } void swap(int *p,int *q) { int temp; temp=*p; *p=*q; *q=temp; }
转载于:https://www.cnblogs.com/2016024263wky/p/6601506.html