diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo1.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo1.java" new file mode 100644 index 0000000000000000000000000000000000000000..4ad4eeb045583ab11776228e5fc670b3bc9013d0 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo1.java" @@ -0,0 +1,47 @@ +package kkkkk; + +import java.util.Random; + +public class Demo1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Random random =new Random(); + int a[]=new int[10]; + System.out.println("¸Ä±äǰ"); + for (int i = 0; i < 10; i++) { + a[i]=random.nextInt(100)+1; + System.out.print(a[i]+"\t"); + } + int max=a[0]; + int min=a[0]; + for (int i = 1; i < 10; i++) { + if (maxa[i]) { + min=a[i]; + } + } + System.out.println(); + num(max,min,a); +} + + public static void num(int max, int min,int[]a) { + int d; + d=a[0]; + a[0]=max; + max=d; + int g; + g=a[9]; + a[9]=min; + min=g; + System.out.println("¸Ä±äºó"); + for (int i = 0; i < 10; i++) { + System.out.print(a[i]+"\t"); + } + } + +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo2.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo2.java" new file mode 100644 index 0000000000000000000000000000000000000000..1e601421498c3f7c339e2fe2a03f92485ff8d857 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo2.java" @@ -0,0 +1,32 @@ +package kkkkk; + +public class Demo2 { + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + Random random =new Random(); + int a[]=new int[20]; + for (int i = 0; i < 20; i++) { + a[i]=random.nextInt(10)+1; + } + System.out.println("请输入一个值ֵ"); + int b=scanner.nextInt(); + System.out.println("出现了"+num(b,a)); + + } + + public static int num(int d,int[] a) { + int c; + int sum=0; + for (int i = 0; i < 20; i++) { + c=a[i]; + System.out.print(c+"\t"); + if (c==d) { + sum++; + } + } + System.out.println(); + return sum; + + } +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo3.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo3.java" new file mode 100644 index 0000000000000000000000000000000000000000..1a27ce175aa4b170a14aba432a0031d0530622d1 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\224\220\345\207\241\350\276\211/Demo3.java" @@ -0,0 +1,25 @@ +package kkkkk; + +public class Demo3 { + public class Wusasuhd { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + System.out.println("ÇëÊäÈënµÄÖµ"); + int n=scanner.nextInt(); + System.out.println("ÇëÔÙÊäÈëmµÄÖµ"); + int m=scanner.nextInt(); + System.out.println("×îÖÕ½á¹ûΪ£º"+num(n,m)); + + } + + public static int num(int n, int m) { + int sum=1; + for (int i = 1; i <=n; i++) { + sum*=m; + } + return sum; + } +} + } diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo1.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo1.java" new file mode 100644 index 0000000000000000000000000000000000000000..4ad4eeb045583ab11776228e5fc670b3bc9013d0 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo1.java" @@ -0,0 +1,47 @@ +package kkkkk; + +import java.util.Random; + +public class Demo1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Random random =new Random(); + int a[]=new int[10]; + System.out.println("¸Ä±äǰ"); + for (int i = 0; i < 10; i++) { + a[i]=random.nextInt(100)+1; + System.out.print(a[i]+"\t"); + } + int max=a[0]; + int min=a[0]; + for (int i = 1; i < 10; i++) { + if (maxa[i]) { + min=a[i]; + } + } + System.out.println(); + num(max,min,a); +} + + public static void num(int max, int min,int[]a) { + int d; + d=a[0]; + a[0]=max; + max=d; + int g; + g=a[9]; + a[9]=min; + min=g; + System.out.println("¸Ä±äºó"); + for (int i = 0; i < 10; i++) { + System.out.print(a[i]+"\t"); + } + } + +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo2.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo2.java" new file mode 100644 index 0000000000000000000000000000000000000000..1e601421498c3f7c339e2fe2a03f92485ff8d857 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo2.java" @@ -0,0 +1,32 @@ +package kkkkk; + +public class Demo2 { + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + Random random =new Random(); + int a[]=new int[20]; + for (int i = 0; i < 20; i++) { + a[i]=random.nextInt(10)+1; + } + System.out.println("请输入一个值ֵ"); + int b=scanner.nextInt(); + System.out.println("出现了"+num(b,a)); + + } + + public static int num(int d,int[] a) { + int c; + int sum=0; + for (int i = 0; i < 20; i++) { + c=a[i]; + System.out.print(c+"\t"); + if (c==d) { + sum++; + } + } + System.out.println(); + return sum; + + } +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo3.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo3.java" new file mode 100644 index 0000000000000000000000000000000000000000..1a27ce175aa4b170a14aba432a0031d0530622d1 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\225\206\350\265\242\346\227\255/Demo3.java" @@ -0,0 +1,25 @@ +package kkkkk; + +public class Demo3 { + public class Wusasuhd { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + System.out.println("ÇëÊäÈënµÄÖµ"); + int n=scanner.nextInt(); + System.out.println("ÇëÔÙÊäÈëmµÄÖµ"); + int m=scanner.nextInt(); + System.out.println("×îÖÕ½á¹ûΪ£º"+num(n,m)); + + } + + public static int num(int n, int m) { + int sum=1; + for (int i = 1; i <=n; i++) { + sum*=m; + } + return sum; + } +} + } diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo1.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo1.java" new file mode 100644 index 0000000000000000000000000000000000000000..4ad4eeb045583ab11776228e5fc670b3bc9013d0 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo1.java" @@ -0,0 +1,47 @@ +package kkkkk; + +import java.util.Random; + +public class Demo1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Random random =new Random(); + int a[]=new int[10]; + System.out.println("¸Ä±äǰ"); + for (int i = 0; i < 10; i++) { + a[i]=random.nextInt(100)+1; + System.out.print(a[i]+"\t"); + } + int max=a[0]; + int min=a[0]; + for (int i = 1; i < 10; i++) { + if (maxa[i]) { + min=a[i]; + } + } + System.out.println(); + num(max,min,a); +} + + public static void num(int max, int min,int[]a) { + int d; + d=a[0]; + a[0]=max; + max=d; + int g; + g=a[9]; + a[9]=min; + min=g; + System.out.println("¸Ä±äºó"); + for (int i = 0; i < 10; i++) { + System.out.print(a[i]+"\t"); + } + } + +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo2.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo2.java" new file mode 100644 index 0000000000000000000000000000000000000000..1e601421498c3f7c339e2fe2a03f92485ff8d857 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo2.java" @@ -0,0 +1,32 @@ +package kkkkk; + +public class Demo2 { + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + Random random =new Random(); + int a[]=new int[20]; + for (int i = 0; i < 20; i++) { + a[i]=random.nextInt(10)+1; + } + System.out.println("请输入一个值ֵ"); + int b=scanner.nextInt(); + System.out.println("出现了"+num(b,a)); + + } + + public static int num(int d,int[] a) { + int c; + int sum=0; + for (int i = 0; i < 20; i++) { + c=a[i]; + System.out.print(c+"\t"); + if (c==d) { + sum++; + } + } + System.out.println(); + return sum; + + } +} diff --git "a/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo3.java" "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo3.java" new file mode 100644 index 0000000000000000000000000000000000000000..1a27ce175aa4b170a14aba432a0031d0530622d1 --- /dev/null +++ "b/java\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\346\236\227\345\263\260/Demo3.java" @@ -0,0 +1,25 @@ +package kkkkk; + +public class Demo3 { + public class Wusasuhd { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scanner =new Scanner(System.in); + System.out.println("ÇëÊäÈënµÄÖµ"); + int n=scanner.nextInt(); + System.out.println("ÇëÔÙÊäÈëmµÄÖµ"); + int m=scanner.nextInt(); + System.out.println("×îÖÕ½á¹ûΪ£º"+num(n,m)); + + } + + public static int num(int n, int m) { + int sum=1; + for (int i = 1; i <=n; i++) { + sum*=m; + } + return sum; + } +} + }