摘要: 1 package 基础题; 2 3 public class Test1 { 4 public static void main(String []args) { 5 System.out.println("善学如春起之苗"); 6 System.out.println("不见其增,日有所长"); 阅读全文
posted @ 2022-03-07 08:39 余鑫2020 阅读(39) 评论(0) 推荐(0)
摘要: 1 package 第五章基础知识数组; 2 3 public class _1数组Arrays中常用的静态方法_重要 { 4 5 6 public static void main(String[] args) { 7 // Arrays中常用的静态方法 8 // 1.java.util.Arra 阅读全文
posted @ 2022-01-17 11:08 余鑫2020 阅读(101) 评论(0) 推荐(0)
摘要: 1 package Number; 2 3 public class _3_4运算符 { 4 5 public static void main(String[] args) { 6 // 运算符是一些特殊的符号,主要用于数学函数,一些类型的赋值语句和逻辑比较方面.java中提供了丰富的运算符 7 阅读全文
posted @ 2021-12-31 19:15 余鑫2020 阅读(69) 评论(0) 推荐(0)
摘要: 1 package Number; 2 3 public class _3_2基本数据类型 { 4 5 public static void main(String[] args) { 6 // 在java中有8种基本数据类型来存储\字符和布尔值 7 /* 8 1.数值型 a.整数类型(byte(8 阅读全文
posted @ 2021-12-30 09:11 余鑫2020 阅读(66) 评论(0) 推荐(0)
摘要: 1 package Number; 2 3 public class _3_3变量与常量 { 4 5 public static void main(String[] args) { 6 // TODO Auto-generated method stub 7 /* 8 3.3变量与常量 9 3.3 阅读全文
posted @ 2021-12-30 09:10 余鑫2020 阅读(36) 评论(0) 推荐(0)
摘要: 1 # 2.1.1 直接插入排序法 2 # a=[50,30,65,59,2,36,42,5,9] 3 class Solution: 4 def insertSort(self, a): 5 for i in range(1, len(a)): 6 key = a[i] 7 j = i - 1 8 阅读全文
posted @ 2021-11-22 17:39 余鑫2020 阅读(63) 评论(0) 推荐(0)
摘要: 1 # 问题描述: 给定一个数组a[],其中除了2个数,其他均出现2次,请找到不重复的2个数并返回. 2 # 问题示例: [1,2,5,2,3,3,4,4,9,9,10,1] 返回[5,10] 3 class Solution: 4 def func(self, lit): 5 for i in r 阅读全文
posted @ 2021-11-22 09:19 余鑫2020 阅读(277) 评论(0) 推荐(0)
摘要: 1 # 问题描述: 给定一个表示勒索信内容的字符串和另一个表示杂志内容的字符串,写一个方法判断能否通过剪下杂志中的内容构造出这封勒索信 2 # 若可以 返回True 否则返回False, 注: 杂志字符串中的每一个字符仅能在勒索信中使用一次 3 class Solution: 4 def func( 阅读全文
posted @ 2021-11-22 09:17 余鑫2020 阅读(128) 评论(0) 推荐(0)
摘要: 1 # 问题描述 计算字符串中的单词数,其中一个单词定义为不含空格的连续字符串 2 # 问题示例: 输入 :"Hello, my name is john" 输出 5 3 class Solution: 4 def count_word(self, string): 5 count = 0 6 fo 阅读全文
posted @ 2021-11-22 09:16 余鑫2020 阅读(135) 评论(0) 推荐(0)
摘要: 1 # 问题描述: 两个不重复的数组nums1 和nums2,其中nums1是nums2的子集.在nums2的相应位置找到nums1所有元素的下一个更大数字 2 # nums1中的数字x的下一个更大的是nums2中x右边第1个更大的数字.如果它不存在返回-1, 3 # nums1和nums2中的所有 阅读全文
posted @ 2021-11-21 11:22 余鑫2020 阅读(140) 评论(3) 推荐(0)