数组查找数字5

public class Second {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int []a={2,1,3,4,5};
        for (int i=0;i<a.length-1;i++){
       if(a[i]!=5){i++;}
        }
     System.out.println("这组数里有5呢"); 
     }

}

 

posted @ 2017-04-03 15:54  苏轼的红烧肉  阅读(185)  评论(0编辑  收藏  举报