黑马程序员技术交流社区

标题: 吓到我啦,差点搞不懂自减自加 [打印本页]

作者: RedW    时间: 2018-1-7 17:01
标题: 吓到我啦,差点搞不懂自减自加
关于自加自减:
算数符在前面是先自加自减再使用
算数符在后面是先使用再自加自减
第四题答案相互探讨:
public class Four {

        public static void main(String[] args) {
                // TODO Auto-generated method stub
                int a=4;
                int b=6;
                int c=8;
                int temp;
                if(a<b)
                {
                        temp=b;
                        b=a;
                        a=temp;
                }
                if(b<c)
                {
                        temp=b;
                        b=c;
                        c=temp;
                        if(a<b)
                        {
                                temp=b;
                                b=a;
                                a=temp;
                        }
                }
               
                System.out.println(a + "  " + b + "  " + c);
        }

}



作者: 1414225997    时间: 2018-1-8 09:34
继续努力哈
作者: 渝小妹    时间: 2018-1-8 20:10
温故而知新   加油  
作者: 陈文老师    时间: 2018-1-9 16:51
总结不错,继续加油哟~~~




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2