自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(3)
  • 收藏
  • 关注

原创 1.手动输入两个数字m和n,运算求出m~n之间所有偶数的和 2.输出100以内的所有质数

1.Scanner scanner = new Scanner(System.in); System.out.println(“请输入第一个整数m:”); int m = scanner.nextInt(); System.out.println(“请输入第二个整数n”); int n = scanner.nextInt(); //poor表示m n之间的差 int poor = 0; //oddNum表示两数之间的偶数和 int oddNum = 0; if (m == n || m - n < 2

2022-02-07 10:34:42 2384

原创 关于数组的案例 1.输出杨辉三角 2.输出等腰三角形

1.//杨辉三角 public class Demo6 { public static void main(String[] args) { //输出杨辉三角 int[][] arr=new int[10][]; for(int i=0;i<arr.length;i++) { arr[i]=new int[i+1]; } for(int i=0;i<arr.length;i++) { for(int j=0;j<arr[i].length;j++) { if(j0 || ij) { arr

2022-02-07 10:27:59 326

原创 java代码实现冒泡排序,快速排序,选择排序

冒泡排序 在这里插入代码片 //冒泡排序 public class Bubble { public static void main(String[] args) { //定义一个数组 int[] arr = {12,78,45,89,28}; int temp; for (int i = 0; i < arr.length - 1; i++) { for (int j = 0; j < arr.length - i -1; j++) {

2022-02-07 10:22:45 120

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除