diff --git "a/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/DEMO03.java" "b/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/DEMO03.java" new file mode 100644 index 0000000000000000000000000000000000000000..5e01806bff8d75fe353fb89e5fcc17779e1b4379 --- /dev/null +++ "b/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/DEMO03.java" @@ -0,0 +1,39 @@ + +public class DEMO03 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + int s = getMax(50,100); + System.out.println("数组最大值为:"+s); + int y = getmin(50,100); + System.out.println("数组最小值为:"+y); + + } + + public static int getMax(int num1,int num2) { + int max; + + if(num1>num2) { + max=num1; + }else { + max=num2; + } + + return max; + } + public static int getmin(int num1,int num2) { + int min; + + if(num1>num2) { + min=num2; + }else { + min=num1; + } + + return min; + } + + + +} + diff --git "a/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/demo01.java" "b/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/demo01.java" new file mode 100644 index 0000000000000000000000000000000000000000..78a111a393a3f61d02df01fd150a6df60772c873 --- /dev/null +++ "b/\346\226\271\346\263\225\347\273\203\344\271\240/\345\217\266\351\231\210\350\276\211/demo01.java" @@ -0,0 +1,25 @@ + +public class demo01 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + int s = array(null); + System.out.println("数组最大值为:"+s); + } + public static int array(int [] arr){ + int max=0; + int[] array = {10,20,50,100}; + for(int i=1; i<4;i++) { + if(max