diff --git a/.idea/misc.xml b/.idea/misc.xml
index 0548357..e1f830b 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 8c68c6b..5aebfd1 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,8 +2,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/test6298.iml b/.idea/pan.iml
similarity index 58%
rename from test6298.iml
rename to .idea/pan.iml
index 8b2ade9..d6ebd48 100644
--- a/test6298.iml
+++ b/.idea/pan.iml
@@ -1,10 +1,8 @@
-
+
-
-
-
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..93490c0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# pan
+
diff --git a/jinzhi/jinzhi.iml b/chen123/chen123.iml
similarity index 84%
rename from jinzhi/jinzhi.iml
rename to chen123/chen123.iml
index c90834f..37cc804 100644
--- a/jinzhi/jinzhi.iml
+++ b/chen123/chen123.iml
@@ -5,7 +5,7 @@
-
+
\ No newline at end of file
diff --git a/chen123/src/Main.java b/chen123/src/Main.java
new file mode 100644
index 0000000..3e59c38
--- /dev/null
+++ b/chen123/src/Main.java
@@ -0,0 +1,5 @@
+public class Main {
+ public static void main(String[] args) {
+ System.out.println("Hello world!");
+ }
+}
\ No newline at end of file
diff --git a/chen123/src/jisuan.java b/chen123/src/jisuan.java
new file mode 100644
index 0000000..1107087
--- /dev/null
+++ b/chen123/src/jisuan.java
@@ -0,0 +1,211 @@
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class jisuan{
+ public static void main(String[] args) {
+ JS win=new JS();
+ }
+}
+class JS extends JFrame implements ActionListener{
+ private StringBuilder sBuilder = new StringBuilder();
+ JTextArea text=new JTextArea();
+ double a,b;
+ Double sum;
+ int i;
+ public JS()
+ {
+ setBounds(100,100,400,400);
+ setTitle("计算器");
+ this.setLayout(new BorderLayout());
+ JPanel p1=new JPanel();
+ JPanel p2=new JPanel();
+ text.setPreferredSize(new Dimension (370,60));
+ p2.setLayout(new FlowLayout());
+ p1.add(text);
+ this.add(p1,BorderLayout.NORTH);
+
+
+ p2.setLayout(new GridLayout(5,4));
+ JButton button[]=new JButton[20];
+ button[0]=new JButton("C");
+ button[1]=new JButton(" ");
+ button[2]=new JButton("%");
+ button[3]=new JButton("÷");
+ button[4]=new JButton("7");
+ button[5]=new JButton("8");
+ button[6]=new JButton("9");
+ button[7]=new JButton("x");
+ button[8]=new JButton("4");
+ button[9]=new JButton("5");
+ button[10]=new JButton("6");
+ button[11]=new JButton("—");
+ button[12]=new JButton("1");
+ button[13]=new JButton("2");
+ button[14]=new JButton("3");
+ button[15]=new JButton("+");
+ button[16]=new JButton("");
+ button[17]=new JButton("0");
+ button[18]=new JButton(".");
+ button[19]=new JButton("=");
+
+ for(int i=0;i= 0; i--) {
- char digit = number.charAt(i); // 当前字符
- int value = 0; // 当前字符对应的十进制值
-
- // 根据字符计算其十进制值
- if (Character.isDigit(digit)) {
- value = digit - '0'; // 如果是数字,直接减去'0'的ASCII码
- } else if (digit >= 'A' && digit <= 'F') {
- value = digit - 'A' + 10; // 如果是大写字母,减去'A'的ASCII码后加10
- } else if (digit >= 'a' && digit <= 'f') {
- value = digit - 'a' + 10; // 如果是小写字母,减去'a'的ASCII码后加10
- } else {
- throw new IllegalArgumentException("输入的数字中包含无效字符: " + digit);
- }
-
- // 将当前字符的十进制值乘以权重后累加到结果中
- decimalValue += value * Math.pow(base, power);
- power++; // 权重增加
- }
-
- return decimalValue;
- }
-
- // 辅助方法:将十进制数转换为任意进制
- /**
- * 将十进制数转换为任意进制的数
- *
- * @param decimalValue 要转换的十进制数
- * @param base 目标进制
- * @return 转换后的目标进制数的字符串表示
- */
- public static String fromDecimal(int decimalValue, int base) {
- if (decimalValue == 0) {
- return "0"; // 如果十进制数为0,直接返回"0"
- }
-
- StringBuilder result = new StringBuilder(); // 用于存储转换结果的StringBuilder对象
- char[] digits = "0123456789ABCDEF".toCharArray(); // 表示所有可能的进制字符的数组
-
- // 使用循环进行进制转换
- while (decimalValue > 0) {
- int remainder = decimalValue % base; // 取余数作为当前位的值
- result.insert(0, digits[remainder]); // 将当前位的值添加到结果的开头
- decimalValue /= base; // 十进制数除以目标进制,为下一次循环做准备
- }
-
- return result.toString(); // 返回转换后的结果字符串
- }
-
- // 主方法:执行进制转换
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in); // 创建Scanner对象用于读取用户输入
-
- // 读取要转换的数、其原始进制和目标进制
- System.out.print("请输入要转换的数: ");
- String number = scanner.nextLine();
- System.out.print("请输入该数的原始进制(2-16): ");
- int inputBase = scanner.nextInt();
-
- // 读取目标进制
- System.out.print("请输入目标进制(2-16): ");
- int targetBase = scanner.nextInt();
-
- // 验证输入的有效性
- if (inputBase < 2 || inputBase > 16 || targetBase < 2 || targetBase > 16) {
- System.out.println("无效的进制。进制必须在2到16之间。");
- return; // 如果输入无效,则直接返回,不执行后续操作
- }
-
- try {
- // 将输入的数转换为十进制数
- int decimalValue = toDecimal(number, inputBase);
-
- // 将十进制数转换为目标进制数
- String result = fromDecimal(decimalValue, targetBase);
-
- // 输出转换后的结果
- System.out.println(number + "初始是" + inputBase + "进制;" + "在" + targetBase + "进制下是"+ result);
- } catch (IllegalArgumentException e) {
- // 捕获并处理非法参数异常
- System.out.println("错误: " + e.getMessage());
- }
-
- scanner.close(); // 关闭Scanner对象,释放资源
- }
-}
diff --git a/out/production/chen123/JS.class b/out/production/chen123/JS.class
new file mode 100644
index 0000000..abd5f7d
Binary files /dev/null and b/out/production/chen123/JS.class differ
diff --git a/out/production/chen123/Main.class b/out/production/chen123/Main.class
new file mode 100644
index 0000000..baa3095
Binary files /dev/null and b/out/production/chen123/Main.class differ
diff --git a/out/production/chen123/jisuan.class b/out/production/chen123/jisuan.class
new file mode 100644
index 0000000..4153de1
Binary files /dev/null and b/out/production/chen123/jisuan.class differ
diff --git a/out/production/jinzhi/JinZhi.class b/out/production/jinzhi/JinZhi.class
deleted file mode 100644
index c328a5f..0000000
Binary files a/out/production/jinzhi/JinZhi.class and /dev/null differ