摘要: package com.oop; public class Demo2 { //使用欧几里得算法求解数m和数n最大公约数 public int getGcd(int m,int n){ while(n > 0){ int temp = m % n; m = n; n = temp; } return 阅读全文
posted @ 2022-06-20 09:30 wjxuriel 阅读(122) 评论(0) 推荐(0)
摘要: package com.oop; import java.util.Scanner; public class Demo4 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = 阅读全文
posted @ 2022-06-20 09:17 wjxuriel 阅读(72) 评论(0) 推荐(0)
摘要: package com.oop; public class Demo1 { public static void main(String[] args) { int x = 12321; String s1 = String.valueOf(x); String s2 = new StringBuf 阅读全文
posted @ 2022-06-20 08:58 wjxuriel 阅读(31) 评论(0) 推荐(0)
摘要: package com.oop; public class IsPrime { public static void main(String[] args) { int sum = 0,i,j; for( i = 2; i <= 100;i++) { for( j = 2; j < i;j++) { 阅读全文
posted @ 2022-06-20 08:42 wjxuriel 阅读(271) 评论(0) 推荐(0)
摘要: package com.oop; public class factorical { public static void main(String[] args) { long result = sumOf(10); System.out.println(result); long sum = su 阅读全文
posted @ 2022-06-20 08:41 wjxuriel 阅读(38) 评论(0) 推荐(0)
摘要: package com.oop; public class gongyueshu { public static void main(String[] args) { int result = getCommonDivisor(60, 120); System.out.println(result) 阅读全文
posted @ 2022-06-20 08:41 wjxuriel 阅读(25) 评论(0) 推荐(0)