第二次作业

#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;
 }

 

posted @ 2017-03-22 18:56  心动&动心  阅读(57)  评论(0编辑  收藏  举报