- 博客(6)
- 收藏
- 关注
原创 随便写的关于面积的代码
public class Cuboid extends Rectangular { int high; public void tiji() { int b = length * wide * high; System.out.println("体积为" + b); } } public class Rectangular { int length; int wide; public int getLength() { retu...
2021-09-25 19:33:06
211
原创 使用嵌套结构实现按折扣进行购物。 嵌套功能再熟悉一下
public class Demo8 { public static void main(String[] args) { System.out.println("请输入是否是会员:是(y)/否(其他字符)"); Scanner sc = new Scanner(System.in); int y; String c = sc.next(); switch (c) { case "y": ...
2021-09-24 19:22:20
157
原创 实现商品换购
public class Demo10 { public static void main(String[] args) { System.out.println("请输入消费金额:"); Scanner sc = new Scanner(System.in); int money = sc.nextInt(); System.out.println("是否参加优惠换购活动"); System.out.println("...
2021-09-24 19:20:56
281
原创 添加客户信息 没事练着玩
public class Demo6 { public static void main(String[] args) { System.out.println("我行我素购物管理系统>客户信息管理>添加客户信息"); System.out.print("请输入会员号(<4位整数>): "); Scanner sc = new Scanner(System.in); int vip = sc.nextInt();...
2021-09-24 19:19:02
125
原创 2021-09-24字符逆序输出
public class Demo22 { public static void main(String[] args) { System.out.println("原字符序列: a c u b e p f z"); String[] param = new String[] { "a", "c", "u", "b", "e", "p", "f", "z" }; sort1(param);// 调用升序排序 System.out.pri...
2021-09-24 19:17:05
61
原创 java算法
package Mr_w; /** * 计算100以内偶数之和 * @author * */ public class Demo12 { public static void main(String[] args) { int s = 0; int sum = 0; while (s <= 100) { if (s / 2 == (s + 1) / 2) { sum = sum...
2021-09-22 18:54:18
46
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人