Stay hungry,stay foolish

自学习指针后,自己利用指针编写判断三个数的大小。

//自己把指针看懂后,编的的小程序,分享下小喜悦。
#import

int abc(*p1,t*p2,*p3)
{
    int temp=*p1;
    if (temp<*p2) {
        temp=*p2;
    }
    if (temp<*p3) {
        temp=*p3;
    }
    
    return temp;
}
    


int main(int argc, const char * argv[])
{

    @autoreleasepool {
        int *p1,*p2,*p3;
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        p1=&a;
        p2=&b;
        p3=&c;
        
        int temp=abc(p1,p2,p3);
        printf("%d",temp);
        
       
        
    }
    return 0;
}

posted @ 2015-09-16 17:30  程序员不圆  阅读(230)  评论(0编辑  收藏  举报