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…
作业要求: 我的代码: 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…
Java 用我们学到的知识做处一个小的项目或者游戏等等应该都或多或少的有一点点的成就感吧,下列就是我用所学的基础知识做的猜字谜游戏,并且给他赋予了灵魂哈哈哈.有兴趣的可以尝试的用自己会的知识做一些小的游戏工具什么的提高自己,要不然你的知识不会那么简单的就融会贯通是吧! 有能力的可以把他改写的更加的nice,就把它当伪代码也行啊! 下列用到的基础知识方便有: if for while Random :随机生成数值,JDK封装类 Scanner :我不怎么会描述,可以看看官方文档,嘿嘿,或者也可以看…
import java.util.*; public class tyt { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a=new int[n]; for (int i = 0; i < n; i++) { a[i]=(in.nextInt()); } for (int i = 0; i < n; i++) { int min…
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k=n/10; int i=k/5*2; int j=(k-(k/5)*5)/3; System.out.println(k+i+j); } }…
思路: 第一感觉有点像约瑟夫环.想到用队列解决比较好理解 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();…
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…