2020年7月14日

摘要: /* 先把字符串转为字符数组,遍历字符数组,若ASCII码在65-90之间,则count+1 */ import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scan 阅读全文
posted @ 2020-07-14 15:13 HannaGeng 阅读(1979) 评论(0) 推荐(0)
 
摘要: import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int count 阅读全文
posted @ 2020-07-14 11:23 HannaGeng 阅读(178) 评论(0) 推荐(0)

2020年7月4日

摘要: 先将字符串补成8的倍数,然后再分割字符串,打印输出 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //我也不知 阅读全文
posted @ 2020-07-04 21:19 HannaGeng 阅读(213) 评论(0) 推荐(0)
 
摘要: import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ //输入的是一行数,用空格 阅读全文
posted @ 2020-07-04 17:16 HannaGeng 阅读(209) 评论(0) 推荐(0)

2020年7月3日

摘要: import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String in = sc.nextLine();//不能用nex 阅读全文
posted @ 2020-07-03 14:21 HannaGeng 阅读(166) 评论(0) 推荐(0)
 
摘要: 库 System.out.println(Math.pow(input, 1.0/3)); 牛顿迭代法 import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Sc 阅读全文
posted @ 2020-07-03 11:52 HannaGeng 阅读(205) 评论(0) 推荐(0)
 
摘要: 求解最小公倍数思路: 1.最小公倍数=两个数的乘机 / 两个数的最大公约数 2.最大公约数(辗转相除法)gcd(a,b) gcd(a,b)=gcd(b,r) 将a为较大的数,b为余数,直到b等于0 import java.util.*; public class Main{ public stati 阅读全文
posted @ 2020-07-03 11:16 HannaGeng 阅读(228) 评论(0) 推荐(0)

2020年6月24日

摘要: 1 import java.util.*; 2 3 public class Main { 4 private static boolean match(String matchStr, String str, int matchIdx, int idx) { 5 if (matchIdx == m 阅读全文
posted @ 2020-06-24 21:53 HannaGeng 阅读(312) 评论(0) 推荐(0)

2020年6月21日

摘要: import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int len = sc.nextInt(); for(int i 阅读全文
posted @ 2020-06-21 20:18 HannaGeng 阅读(139) 评论(0) 推荐(0)
 
摘要: import java.util.Scanner; /** * 给定一个仅由小写字母x和y组成且长度不超过105的字符串, * 每次可以将字符串中的一个子串xy替换成字符串yyx, * 那么至少要替换多少次才能让字符串中不存在子串xy? * * 核心要点: * 1. 一个字符串不存在子串xy,则需要 阅读全文
posted @ 2020-06-21 19:18 HannaGeng 阅读(253) 评论(0) 推荐(0)