《MySql面试专题》
《MySql性能优化的21个最佳实践》
《MySQL高级知识笔记》
文中展示的资料包括:**《MySql思维导图》《MySql核心笔记》《MySql调优笔记》《MySql面试专题》《MySql性能优化的21个最佳实践》《MySq高级知识笔记》**如下图
关注我,点赞本文给更多有需要的人
-
@date : 2021/6/4 13:51
-
@project : Java 编程实例
-
@package : PACKAGE_NAME
-
@className : Example31
-
@description :
*/
public class Example31 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] arr = new int[10];
for (int i = 0; i < 10; i++) {
System.out.println(“输入第 " + (i + 1) + " 个元素!”);
arr[i] = scanner.nextInt();
}
System.out.println(“输入的数组为:” + Arrays.toString(arr));
System.out.println(“逆序输出的数组”);
for (int i = arr.length - 1; i >= 0; i–) {
System.out.print(arr[i] + “\t”);
}
}
}
结果
题目
取一个整数 a 从右端开始的 4 ~ 7 位。
分析
输入一个整数,然后将其转换为字符串,然后遍历输出从右端开始的 4 ~ 7 位即可!
实现
import java.util.Scanner;
/**
-
Created with IntelliJ IDEA.
-
@author : cunyu
-
@version : 1.0
-
@email : 747731461@qq.com
-
@website : https://cunyu1943.github.io
-
@date : 2021/6/4 13:56
-
@project : Java 编程实例
-
@package : PACKAGE_NAME
-
@className : Example32
-
@description :
*/
public class Example32 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(“输入一个整数”);
int num = scanner.nextInt();
String str = Integer.toString(num);
System.out.println(“整数从右端开始的 4 ~ 7 位:”);
for (int i = str.length() - 4; i >= str.length() - 7; i–) {
System.out.print(str.charAt(i));
}
}
}
结果
题目
打印杨辉三角。
分析
仔细观察杨慧三角可以看到:
第 0 列和对角线上的数据全部为 1,其余位置上的数据为上一行正对数据与上一行正对前一个数据之和。
比如:a[4][2] = a[3][2] + a[3][1]
实现
import java.util.Scanner;
/**
-
Created with IntelliJ IDEA.
-
@author : cunyu
-
@version : 1.0
-
@email : 747731461@qq.com
-
@website : https://cunyu1943.github.io
-
@date : 2021/6/4 14:01
-
@project : Java 编程实例
-
@package : PACKAGE_NAME
-
@className : Example33
-
@description :
*/
public class Example33 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(“输入杨辉三角的行数”);
int row = scanner.nextInt();
int[][] triangle = new int[row][];
System.out.println(“杨辉三角为:”);
for (int i = 0; i < triangle.length; i++) {
triangle[i] = new int[i + 1];
for (int j = 0; j < triangle[i].length; j++) {
if (i == 0 || j == 0 || i == j) {
triangle[i][j] = 1;
} else {
triangle[i][j] = triangle[i - 1][j] + triangle[i - 1][j - 1];
}
System.out.print(triangle[i][j] + " ");
}
System.out.println();
}
}
}
结果
题目
输入 3 个数 a、b、c,按大小顺序输出。
分析
输入 3 个数存入数组中,然后利用 Arrays.sort()
进行排序,最后按照从小到到输出即可。
实现
import java.util.Arrays;
import java.util.Scanner;
/**
-
Created with IntelliJ IDEA.
-
@author : cunyu
-
@version : 1.0
-
@email : 747731461@qq.com
-
@website : https://cunyu1943.github.io
-
@date : 2021/6/4 14:06
-
@project : Java 编程实例
-
@package : PACKAGE_NAME
-
@className : Example34
-
@description :
*/
public class Example34 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(“输入三个整数”);
int[] arr = new int[3];
最后
分享一些资料给大家,我觉得这些都是很有用的东西,大家也可以跟着来学习,查漏补缺。
《Java高级面试》
《Java高级架构知识》
《算法知识》
都是很有用的东西,大家也可以跟着来学习,查漏补缺。
《Java高级面试》
[外链图片转存中…(img-sJMAQheR-1715358350255)]
《Java高级架构知识》
[外链图片转存中…(img-j36XTcgS-1715358350256)]
《算法知识》
[外链图片转存中…(img-4PiT52tQ-1715358350256)]