- 博客(2)
- 收藏
- 关注
原创 从控制台输入一个数,使用循环打印1到这个数之间的所有整数(比如输入5,打印1.2.3.4.5)
import java.util.*; public class 类名 { public static void main(String[] args) { Scanner sc = new Scanner(System.in);//扫描器 System.out.print("请输入一个数:"); int a = sc.nextInt(); int b = 0;//变量 while (b < a) { .
2021-04-10 01:55:05 879
原创 计算1900-2012年的所有天数
public class 类名 { public static void main(String[] args) { int a = 1900; int b = 0; while (a <= 2012) { a++; if (a%4==0 && a%100!=0 || a%400==0) {//闰年条件 b = b + 366;//满足后加366天 .
2021-04-10 01:39:49 353
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人