05 2022 档案

摘要:import java.util.Scanner; class Main { public static void main(String[] args){ int countOf0 = 0; int countOf1 = 0; for(int i = 0; i < 1000_000; i++){ 阅读全文
posted @ 2022-05-27 16:16 Scenery_Shelley 阅读(165) 评论(0) 推荐(0) 编辑
摘要:十进制转二进制 import java.util.Scanner; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); int numberNotChange = 0 阅读全文
posted @ 2022-05-27 15:24 Scenery_Shelley 阅读(25) 评论(0) 推荐(0) 编辑
摘要:1. 在线编辑公式 在线LaTeX公式编辑 2. 得到MathML <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mfrac><mn>1</mn><mrow><mn>1</mn><mo>+</mo><msqrt 阅读全文
posted @ 2022-05-27 14:06 Scenery_Shelley 阅读(70) 评论(0) 推荐(0) 编辑
摘要:找出1-10,000 之间的四个完全数 比如:6 = 1+2+3 28 = 1+2+4+7+14 import java.util.*; class Main { public static void main(String[] args){ for(int i = 1; i <= 10_000; 阅读全文
posted @ 2022-05-27 11:33 Scenery_Shelley 阅读(41) 评论(0) 推荐(0) 编辑
摘要:取值范围: [0,1) 阅读全文
posted @ 2022-05-27 11:19 Scenery_Shelley 阅读(51) 评论(0) 推荐(0) 编辑
摘要:复利值 每月存100,年利率5%,存6个,月帐面价值多少? import java.util.*; class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); System 阅读全文
posted @ 2022-05-27 11:13 Scenery_Shelley 阅读(47) 评论(0) 推荐(0) 编辑
摘要:显示每月第一天是星期几 输入年份 import java.util.*; import javax.swing.*; class Main { public static void main (String[] args){ Scanner input = new Scanner(System.in 阅读全文
posted @ 2022-05-26 13:50 Scenery_Shelley 阅读(116) 评论(0) 推荐(0) 编辑
摘要:1+1/2+1/3+…+1/n 从右往左更加精确 import java.util.Scanner; class Main { public static void main(String[] args){ int n = 50_000; double sum = 0; for(int i = 1; 阅读全文
posted @ 2022-05-26 12:07 Scenery_Shelley 阅读(56) 评论(0) 推荐(0) 编辑
摘要:比较不同利率下的贷款 import java.util.Scanner; class Main { public static void main(String[] args) { //Create a Scanner Scanner input = new Scanner(System.in); 阅读全文
posted @ 2022-05-25 15:21 Scenery_Shelley 阅读(40) 评论(0) 推荐(0) 编辑
摘要:数字金字塔 import java.util.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.print("Enter the lin 阅读全文
posted @ 2022-05-25 12:36 Scenery_Shelley 阅读(105) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.print("Enter a number as a 阅读全文
posted @ 2022-05-24 17:32 Scenery_Shelley 阅读(50) 评论(0) 推荐(0) 编辑
摘要:!到~ import java.util.*; class Main { public static void main(String[] args){ char ch1 = '!'; char ch2 = '~'; int count = 0; for(int i = (int)ch1;i <= 阅读全文
posted @ 2022-05-24 17:02 Scenery_Shelley 阅读(26) 评论(0) 推荐(0) 编辑
摘要:满足n*n < 12 000的最小数 import java.util.*; class Main { public static void main(String[] args){ int n = 1; while(n * n <= 12000){ n++; } System.out.print( 阅读全文
posted @ 2022-05-24 16:51 Scenery_Shelley 阅读(24) 评论(0) 推荐(0) 编辑
摘要:能被5和6整除 import java.util.*; class Main { public static void main(String[] args){ int count = 0; for(int i = 100; i <= 1000; i++){ if(i % 5 == 0 && i % 阅读全文
posted @ 2022-05-24 16:43 Scenery_Shelley 阅读(280) 评论(0) 推荐(0) 编辑
摘要:找出最高分学生和姓名 import java.util.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); double maxScoreOfStudent = 阅读全文
posted @ 2022-05-24 16:16 Scenery_Shelley 阅读(76) 评论(0) 推荐(0) 编辑
摘要:假设今年某大学的学费为10_000美元,学费的年增长率为5%。 编写程序,计算10年后的学费以及从现在开始的10年后算起,4年内的总学费是多少? import java.util.*; class Main { public static void main(String[] arg){ doubl 阅读全文
posted @ 2022-05-24 15:10 Scenery_Shelley 阅读(71) 评论(0) 推荐(0) 编辑
摘要:千克和磅之间的换算 import java.util.*; class Main { public static void main(String[] args){ System.out.print("千克 磅"); for(int i=1 ; i<200; i++){ float j = i * 阅读全文
posted @ 2022-05-20 17:31 Scenery_Shelley 阅读(613) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.prin 阅读全文
posted @ 2022-05-20 17:10 Scenery_Shelley 阅读(145) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ int sum = 0; //Keep reading data until the user answer 阅读全文
posted @ 2022-05-20 12:08 Scenery_Shelley 阅读(20) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ final int NUMBER_OF_PRIMES = 50;//Number of primes to d 阅读全文
posted @ 2022-05-20 11:56 Scenery_Shelley 阅读(30) 评论(0) 推荐(0) 编辑
摘要:continue 跳出一次迭代 在while和do-while循环中,continue语句之后会马上计算循环继续条件 而在for循环中,continue语句之后会立即先执行每次迭代后的动作,再计算循环继续条件 break 跳出整个循环 猜数字 import java.util.*; import j 阅读全文
posted @ 2022-05-20 11:32 Scenery_Shelley 阅读(43) 评论(0) 推荐(0) 编辑
摘要:假设圆的半径为1,圆的面积为PI,外接正方形的面积为4. 随机产生一个点落在圆内的概率为PI/4 import java.util.*; class Main { public static void main(String[] args){ final int NUMBER_OF_TRIALS = 阅读全文
posted @ 2022-05-20 11:19 Scenery_Shelley 阅读(28) 评论(0) 推荐(0) 编辑
摘要:假设某个大学今年的学费是10000美金,且以每年7%的速度增加。多少年后学费会翻倍? import java.util.*; class Main { public static void main(String[] args){ double tuition = 10000; int year = 阅读全文
posted @ 2022-05-20 11:05 Scenery_Shelley 阅读(80) 评论(0) 推荐(0) 编辑
摘要:第一种方法 import java.util.*; class Main { public static void main(String[] args){ //Create a scanner Scanner input = new Scanner(System.in); //Prompt the 阅读全文
posted @ 2022-05-19 20:29 Scenery_Shelley 阅读(19) 评论(0) 推荐(0) 编辑
摘要:从大到小添加数字没有从小到大添加数字精确 在大数之前先增加小数是减小误差的一种方法 import java.util.*; class Main { public static void main(String[] args){ //Initialize sum float sum = 0; //A 阅读全文
posted @ 2022-05-19 20:16 Scenery_Shelley 阅读(24) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; class Main { public static void main(String[] args){ //Display the table heading System.out.println(" Multiplication Table"); //Di 阅读全文
posted @ 2022-05-19 19:58 Scenery_Shelley 阅读(17) 评论(0) 推荐(0) 编辑
摘要:使用while循环实现 import java.util.*; class Main { public static void main(String[] args){ //Create a Scanner Scanner input = new Scanner(System.in); //Read 阅读全文
posted @ 2022-05-17 16:49 Scenery_Shelley 阅读(27) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ int number = (int)(Math.random()* 101); Scanner input = 阅读全文
posted @ 2022-05-17 15:46 Scenery_Shelley 阅读(21) 评论(0) 推荐(0) 编辑
摘要:圆心之间的距离和 |r1-r2|及(r1+r2)之间比较 import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ Scanner input = new Scanne 阅读全文
posted @ 2022-05-17 15:30 Scenery_Shelley 阅读(216) 评论(0) 推荐(0) 编辑
摘要:PL1,PR1 表示为矩形1 的左上角 和 右下角 的 点 PL2,PR2 表示为矩形2 的左上角 和 右下角 的 点 PR1.x ⇐ PL2.x 表示矩形1 在矩形2 的左边,不重叠 PL1.x >= PR2.x 表示矩形1 在矩形2 的右边,不重叠 PL1.y ⇐ PR2.y 表示矩形1 在矩形 阅读全文
posted @ 2022-05-17 10:51 Scenery_Shelley 阅读(887) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.prin 阅读全文
posted @ 2022-05-15 22:54 Scenery_Shelley 阅读(347) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ int cardNumber = (int)(Math.random() * 100) % 13; int c 阅读全文
posted @ 2022-05-15 22:43 Scenery_Shelley 阅读(81) 评论(0) 推荐(0) 编辑
摘要:点是否在圆内 import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.o 阅读全文
posted @ 2022-05-15 14:48 Scenery_Shelley 阅读(32) 评论(0) 推荐(0) 编辑
摘要:泽勒一致性 import java.util.*; import javax.swing.*; class Main { public static void main (String[] args){ Scanner input = new Scanner(System.in); System.o 阅读全文
posted @ 2022-05-13 12:57 Scenery_Shelley 阅读(35) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; import javax.swing.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.prin 阅读全文
posted @ 2022-05-13 12:21 Scenery_Shelley 阅读(34) 评论(0) 推荐(0) 编辑
摘要:猜一次 import java.util.*; class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.print("scissor(0), roc 阅读全文
posted @ 2022-05-13 11:37 Scenery_Shelley 阅读(29) 评论(0) 推荐(0) 编辑
摘要:使用System.currentTimeMillis()方法 public class HelloWorld { public static void main(String []args) { long totalMilliseconds = System.currentTimeMillis(); 阅读全文
posted @ 2022-05-13 10:44 Scenery_Shelley 阅读(106) 评论(0) 推荐(0) 编辑
摘要:生成输入框 String numberString1 = JOptionPane.showInputDialog("Enter the first number: "); 生成消息框 JOptionPane.showMessageDialog(null, number1 + " <= " + num 阅读全文
posted @ 2022-05-11 15:47 Scenery_Shelley 阅读(20) 评论(0) 推荐(0) 编辑
摘要:ax^2 + bx + c = 0 import javax.swing.JOptionPane; import java.util.*; class Main { public static void main(String[] args){ Scanner input = new Scanner 阅读全文
posted @ 2022-05-11 14:54 Scenery_Shelley 阅读(23) 评论(0) 推荐(0) 编辑
摘要:[0,20) [10,20) [10,50] import javax.swing.JOptionPane; import java.util.*; class Main { public static void main(String[] args){ int number = (int)(Mat 阅读全文
posted @ 2022-05-11 13:04 Scenery_Shelley 阅读(30) 评论(0) 推荐(0) 编辑
摘要:运算符优先级表(从高到低) ++在前,先变后用,++在后,先用后变 var++ var--() +、-(一元加减)、++var 、--var 、(type) ! 、/、% 、-(二元加减) <、<= 、> 、>= == 、!= ^ && | | = 、+= 、-= 、*= 、/= 、%= 相邻运算符 阅读全文
posted @ 2022-05-11 12:18 Scenery_Shelley 阅读(108) 评论(0) 推荐(0) 编辑
摘要:System.out.printf(format, item1, item2, ..., items) 标识符 输出 举例 %b boolean ture false %c char ’a’ %d 十进制整数 200 %f float 45.460000 %e 标准科学记数法 4.556000e+0 阅读全文
posted @ 2022-05-11 12:14 Scenery_Shelley 阅读(38) 评论(0) 推荐(0) 编辑
摘要:boolean-expression ? expression1 : expression2 y = (x >0) ? 1 : -1; max = (num1 > num2) ? num1 : num2; System.out.println((num % 2 == 0) ? "num is eve 阅读全文
posted @ 2022-05-11 11:32 Scenery_Shelley 阅读(20) 评论(0) 推荐(0) 编辑
摘要:#两位数 import java.util.*; class Main { public static void main(String[] args){ //Generate a lottery int lottery = (int)(Math.random() * 100); //Prompt 阅读全文
posted @ 2022-05-11 11:07 Scenery_Shelley 阅读(177) 评论(0) 推荐(0) 编辑
摘要:判断是否为闰年 非对话框实现 import java.util.*; class Main { public static void main(String[] args){ //Create a Scanner Scanner input = new Scanner(System.in); Sys 阅读全文
posted @ 2022-05-11 10:24 Scenery_Shelley 阅读(32) 评论(0) 推荐(0) 编辑
摘要:if else语句实现 import java.util.*; class Main { public static void main(String args[]){ //Create a Scanner Scanner input = new Scanner(System.in); //Prom 阅读全文
posted @ 2022-05-10 19:21 Scenery_Shelley 阅读(39) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; class Main { public static void main(String args[]){ Scanner input = new Scanner(System.in); //prompt the user to enter weight in 阅读全文
posted @ 2022-05-10 18:01 Scenery_Shelley 阅读(48) 评论(0) 推荐(0) 编辑
摘要:单次计算 import java.util.*; class Main { public static void main(String []args) { //1. Generate two random single-digit integers int number1 = (int)(Math 阅读全文
posted @ 2022-05-10 17:44 Scenery_Shelley 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Set1 二进制为:xxxx1 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 30 Set2 二进制为:xxx1x 2 3 6 7 10 11 14 15 18 19 22 23 26 27 30 31 Set3 二进制为:xx1xx 4 5 6 7 12 13 1 阅读全文
posted @ 2022-05-09 16:37 Scenery_Shelley 阅读(168) 评论(0) 推荐(0) 编辑
摘要:计算贷款支付额 月支付额 = 贷款总额月利率 /(1-1/(1+月利率)^(年数12)) import java.util.Scanner; class Main { public static void main(String[] args) { //Create a Scanner Scanne 阅读全文
posted @ 2022-05-08 15:44 Scenery_Shelley 阅读(81) 评论(0) 推荐(0) 编辑
摘要:import java.util.*; class Main { public static void main(String []args) { Scanner input = new Scanner(System.in); System.out.print("Enter the time zon 阅读全文
posted @ 2022-05-08 13:17 Scenery_Shelley 阅读(40) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示