- 博客(4)
- 收藏
- 关注
原创 单例模式和工厂方法模式
//单例模式/** *饿汉式的单例模式 * 程序初始化时就建立好了 * @author luthor21 */class Singletone{ private static final Singletone s = new Singletone(); private Singletone(){} public static Singletone getInstance(){ return s; }}/** *懒汉式的单例模式 * 在使用
2020-09-21 10:46:20
236
原创 京东21.8.27笔试
package lianxi.jingdong21a;////某人只喜欢数字 2, 3, 5这三个数字,如222,333,235这样的。//但是12345这样就不是他喜欢的,因为包含了除了2,3,5以外的数字。//现询问这个人喜欢的第n个数字(升序排列的第n个数字)是多少。 n <= 1000;//例如 n 等于 5 时,答案为 23。//因为升序排序依次为 2,3,5,22,23。。。所以第5个数字为23.import java.util.Scanner;class Like{
2020-09-17 17:07:36
120
原创 广联达笔试01
t01种草public class t01 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int x = sc.nextInt(); int[] arr = new int[n]; for (int i=
2020-09-16 18:25:18
345
原创 图论算法的矩阵实现
图论算法的矩阵写法BFS_mpublic static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int start = sc.nextInt(); int matrix[][] = new int[n][n]; for (int i=0;i<n;i++){ for
2020-09-16 17:09:17
293
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人