作业要求: 我的代码: package day20181119;/** * 猜拳游戏 * @author Administrator * @version1.0 */import java.util.Scanner;public class FingerGuessing { String chName; String name; int i; int ch1; int Score1; int ch2; int Score2; public void showLoginMenu(){ System…
题目:合并两个已排序链表 难度:Easy 题目内容: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 翻译: 合并两个已排序的链表,并将其作为一个新链表返回.新的链表应该通过将前两个列表的节点拼接在一起. Example: Input: 1->2->4, 1-&…
Java 用我们学到的知识做处一个小的项目或者游戏等等应该都或多或少的有一点点的成就感吧,下列就是我用所学的基础知识做的猜字谜游戏,并且给他赋予了灵魂哈哈哈.有兴趣的可以尝试的用自己会的知识做一些小的游戏工具什么的提高自己,要不然你的知识不会那么简单的就融会贯通是吧! 有能力的可以把他改写的更加的nice,就把它当伪代码也行啊! 下列用到的基础知识方便有: if for while Random :随机生成数值,JDK封装类 Scanner :我不怎么会描述,可以看看官方文档,嘿嘿,或者也可以看…
import java.util.Scanner; public class tyt { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k=in.nextInt(); int[] ints=new int[n]; int f=n; int value=0; for(int i=0;i<n;i++) { ints[i]=i+1; } wh…
思路: 第一感觉有点像约瑟夫环.想到用队列解决比较好理解 import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt();…
名称 Go中25个关键字 只能在语法允许的地方使用,不能做为名称 break default func interface select case defer go map struct chan else goto pacakage switch const if range type continue for import return var 内置的预声明的常量.类型和函数名称.这些名称不是预留的,可以对其重声明,但这会有冲突的风险. 常量 true false iota nil 类型 i…
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially positioned in the top-left room and must fight his wa…