练习
ℋello world
这个作者很懒,什么都没留下…
展开
-
Java 将m行n列数组从1~m*n螺旋输出
将m行n列数组从1~m*n螺旋输出效果如下:import java.util.Scanner;public class LuoxuanDemo { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int m = sc.nextInt(); int n = sc.nextInt(); //给定数组----存储数据原创 2021-07-20 22:09:43 · 369 阅读 · 0 评论 -
Java 猴子选大王
猴子选大王最普通方法:标志位方法public class MonkeyDemo { public static void main(String[] args){ //0代表猴子存在,1代表猴子淘汰 int[] monkey =new int[15]; //记录猴子剩余数量 int count=15; int n = 0;//数组下标 int num = 1;//计数:猴子遇到7的倍数淘汰原创 2021-07-20 21:59:18 · 362 阅读 · 0 评论 -
Java 统计总代码行数
统计工程里总代码行数缺点:此方法还不够完善,会把代码中空行计算进去(待完善)import java.io.*;public class JavaDemo { //统计变量 private static int count; public static void main(String[] args) throws IOException { //创建代表文件类的对象 File file = new File("D:\\workpaspace原创 2021-07-20 21:50:39 · 230 阅读 · 0 评论