Fork me on GitHub
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 26 下一页
摘要: ``` import java.util.Stack; public class Main { public Double Evaluate(String str) { Stack sk1 = new Stack(); Stack sk2 = new Stack(); for(int i = 0;i 阅读全文
posted @ 2019-07-08 11:08 cznczai 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Java输入字符串时next()和nextLine()的区别: 1.next()是在输入的一行中,到第一个空格为止,作为本次要输入的字符串,比如我可能输入“I am a girl.”,其实只会存储“I”; 2.nextLine()是在输入的一行中,到回车为止,作为本次输入的字符串(包括空格); 波兰 阅读全文
posted @ 2019-07-08 11:07 cznczai 阅读(850) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Main { //这道题算二十四点采用的是递归的做法 //arr[]存放的是 四张牌的大小 , m 是还没操作的牌数 public static boolean is24(double[] arr, int m) { // 阅读全文
posted @ 2019-07-08 11:06 cznczai 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 输入n个整数,找出其中两个数,他们之和等于整数m 如果存在输出 true 不存在输出false 我这里用的是二分查找以及双指针 双指针 二分查找 阅读全文
posted @ 2019-07-08 11:05 cznczai 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 按照顺序 以及加入选与不选的问题 采用递归方法表达 并在每一条执行函数中加入参数保存当前字符串的情况 当判断完毕时 输出该字符串 小范围还好 大范围则可能会溢出 求字符串子串 模板 里面会多一种"" 空字符串 栈的写法 搜索中看到一些文章 插在这里把https://blog.csdn.net/mor 阅读全文
posted @ 2019-07-08 11:04 cznczai 阅读(265) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2018.cnblogs.com/blog/1648545/201907/1648545-20190708110103430-1342758248.png) ``` import java.util.*; public class Main { public static void main(String[] args) { Scanner sc =... 阅读全文
posted @ 2019-07-08 11:02 cznczai 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 以下资料室是学习矩阵快速幂 够用了 一些矩阵的选择可以自己算一下 普通快速幂的教程:https://v.qq.com/x/page/l0323gb50p2.html 模板 矩阵快速幂的教程:https://v.qq.com/x/page/i03233ew1gm.html 参考:https://blo 阅读全文
posted @ 2019-07-08 10:54 cznczai 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目: 围棋棋盘由19 19条线组成,这些线公组成了多少个正方形 1有18 2有17 3有16................18有1 自己的解法 public class Main{ public static void main(String[] args) { long sum = 0; fo 阅读全文
posted @ 2019-07-08 10:52 cznczai 阅读(1153) 评论(0) 推荐(0) 编辑
摘要: ... 续行符 clear 清除工作区窗口 clc 清楚命令窗口 int范围2 带符号 2^7~2^7 1 无符号 0 ~ 2^8 1 用uint8(8):将8转化位无符号8位整数 用 int8(8):将8转化为有符号8位整数 int8(129) = 127(有符号最大只能表示127 无法表示128 阅读全文
posted @ 2019-07-08 10:50 cznczai 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 汉诺塔问题一直是我想解决的问题之一,汉诺塔也是让我感到编程的神奇之处,想了很久也领悟不了里面的奥秘。 附上灯哥教学视频https://www.bilibili.com/video/av9830115?from=search&seid=6226553387047262312 递归写法 n = N % 阅读全文
posted @ 2019-07-08 10:49 cznczai 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 26 下一页