From b6b611d1f44207c98d67ac5e8dba452f435831c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BD=B3=E7=82=9C?= <626104790@qq.com> Date: Wed, 21 Dec 2022 20:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=ACnnm=E6=AC=A1=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221221 \344\275\263\347\202\234.md" | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 "26 \351\231\210\344\275\263\347\202\234/20221221 \344\275\263\347\202\234.md" diff --git "a/26 \351\231\210\344\275\263\347\202\234/20221221 \344\275\263\347\202\234.md" "b/26 \351\231\210\344\275\263\347\202\234/20221221 \344\275\263\347\202\234.md" new file mode 100644 index 0000000..dd7149e --- /dev/null +++ "b/26 \351\231\210\344\275\263\347\202\234/20221221 \344\275\263\347\202\234.md" @@ -0,0 +1,138 @@ +# 作业 + +```java +import java.util.Scanner; + +public class five { + public static void main(String[] args) { + System.out.println("请输入园的半径"); + Scanner sc = new Scanner(System.in); + int bj= sc.nextInt(); + radius(bj); + } + public static void radius(int bj){ + double mj = bj*bj*3.14; + double zc = bj*3.14*2; + System.out.println("园的面积为"+mj); + System.out.println("园的周长为"+zc); + } +} +``` + +```java +import java.util.Arrays; +import java.util.Random; +import java.util.Scanner; +public class six { + public static void main(String[] args) { + int[] n=new int[20]; + for (int i=0;i max) { + max = n[i]; + a = i; + } + } + int t = n[a]; + n[a] = n[0]; + n[0] = t; + for (int j = 0; j < 10; j++) { + if (n[j] < min) { + min = n[j]; + b = j; + } + } + int tt = n[b]; + n[b] = n[9]; + n[9] = tt; + return n; + } + } +``` + +```java +import java.util.Scanner; +public class eight { + public static void main(String[] args) { + System.out.println("输入数组元素个数"); + Scanner n=new Scanner(System.in); + int[] a=new int[n.nextInt()]; + System.out.println("请输入"+a.length+"个元素"); + for (int i=0;i