输入a和b两个整数,按先大后小的顺序输出a和b

来源:互联网 发布:彩票开奖数据 编辑:程序博客网 时间:2024/05/19 02:44
/* Note:Your choice is C IDE */#include "stdio.h"main(){    int*p1,*p2,*p,a,b;    printf("please enter two number:");    scanf("%d,%d",&a,&b);    p1=&a;    p2=&b;    if(a<b)    {p=p1;p1=p2;p2=p;}    printf("a=%d,b=%d\n",a,b);    printf("max=%d,min=%d\n",*p1,*p2);    return 0;}


0 0