阅读背景:

输入3个整数,从小到大输出(指针处理)

来源:互联网 

类型:指针

时间:2017.3.28

 
 
#include <stdio.h> 
int main(void)
{	
int a,b,c,*p1=&a,*p2=&b,*p3=&c,*p;
printf("input three integers:") ;
scanf("%d%d%d",p1,p2,p3);
if(*p1>*p2)
{
p=p1;
p1=p2;
p2=p;
}
if(*p1>*p3)
{
p=p1;
p1=p3;
p3=p;
}
if(*p2>*p3)
{
p=p2;
p2=p3;
p3=p;
}
printf("*p1=%d,*p2=%d,*p3=%d\n",*p1,*p2,*p3);
return 0;
}#include <stdio.h>



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: