当前位置: 首页 > 编程日记 > 正文

0414复利计算6.0--结对

结对同伴:

姓名:柯晓君

学号:201406114210

博客园地址:http://www.cnblogs.com/950525kxj/

一、项目简介

开发工具:eclipse

开发语言:java

主要功能:复利单利的计算、贷款的计算以及投资运算三大功能。

二、新增功能

做出一部分功能的界面

三、估计

估计用时:5小时

实际用时:6小时

估计代码行数:500行左右

实际代码行数:470行

四、任务分配

由于我们两人对做界面都不熟悉,所以是一起做的,没具体分工。

五、新增代码

  1 import java.awt.event.KeyAdapter;
  2 import java.awt.event.KeyEvent;
  3 import java.awt.event.MouseAdapter;
  4 import java.awt.event.MouseEvent;
  5 
  6 import javax.swing.DefaultComboBoxModel;
  7 import javax.swing.JButton;
  8 import javax.swing.JComboBox;
  9 import javax.swing.JFrame;
 10 import javax.swing.JLabel;
 11 import javax.swing.JOptionPane;
 12 import javax.swing.JRadioButton;
 13 import javax.swing.JTextField;
 14 import javax.swing.SwingUtilities;
 15 import javax.swing.UIManager;
 16 
 17 import org.dyno.visual.swing.layouts.Constraints;
 18 import org.dyno.visual.swing.layouts.GroupLayout;
 19 import org.dyno.visual.swing.layouts.Leading;
 20 
 21 //VS4E -- DO NOT REMOVE THIS LINE!
 22 public class Fulijisuan extends JFrame {
 23 
 24     private static final long serialVersionUID = 1L;
 25     private JTextField jTextField0;
 26     private JTextField jTextField1;
 27     private JTextField jTextField2;
 28     private JTextField jTextField3;
 29     private JLabel jLabel0;
 30     private JLabel jLabel1;
 31     private JLabel jLabel2;
 32     private JLabel jLabel3;
 33 
 34     private JButton jButton0;
 35     private JButton jButton1;
 36 
 37     public Fulijisuan() {
 38         initComponents();
 39     }
 40 
 41     private void initComponents() {
 42         setLayout(new GroupLayout());
 43         add(getJTextField0(), new Constraints(new Leading(121, 132, 10, 10), new Leading(26, 38, 10, 10)));
 44         add(getJTextField1(), new Constraints(new Leading(121, 132, 10, 10), new Leading(85, 41, 10, 10)));
 45         add(getJTextField2(), new Constraints(new Leading(121, 132, 10, 10), new Leading(148, 39, 10, 10)));
 46         add(getJLabel0(), new Constraints(new Leading(59, 44, 12, 12), new Leading(30, 31, 12, 12)));
 47         add(getJLabel1(), new Constraints(new Leading(55, 43, 10, 10), new Leading(85, 40, 12, 12)));
 48         add(getJLabel2(), new Constraints(new Leading(62, 12, 12), new Leading(146, 39, 10, 10)));
 49         add(getJLabel3(), new Constraints(new Leading(59, 10, 10), new Leading(216, 37, 12, 12)));
 50         add(getJComboBox1(), new Constraints(new Leading(323, 120, 10, 10), new Leading(128, 31, 10, 10)));
 51         add(getJTextField3(), new Constraints(new Leading(121, 132, 10, 10), new Leading(216, 41, 10, 10)));
 52         add(getJRadioButton0(), new Constraints(new Leading(326, 10, 10), new Leading(197, 12, 12)));
 53         add(getJButton0(), new Constraints(new Leading(124, 10, 10), new Leading(290, 10, 10)));
 54         add(getJButton2(), new Constraints(new Leading(233, 10, 10), new Leading(292, 10, 10)));
 55         add(getJComboBox0(), new Constraints(new Leading(323, 120, 10, 10), new Leading(67, 32, 10, 10)));
 56         setSize(460, 374);
 57     }
 58 
 59     private JButton getJButton2() {
 60         if (jButton2 == null) {
 61             jButton2 = new JButton();
 62             jButton2.setText("清除");
 63             jButton2.addMouseListener(new MouseAdapter() {
 64 
 65                 public void mouseClicked(MouseEvent event) {
 66                     jButton1MouseMouseClicked(event);
 67                 }
 68             });
 69         }
 70         return jButton2;
 71     }
 72 
 73     private JButton getJButton0() {
 74         if (jButton0 == null) {
 75             jButton0 = new JButton();
 76             jButton0.setText("计算");
 77             jButton0.addMouseListener(new MouseAdapter() {
 78 
 79                 public void mouseClicked(MouseEvent event) {
 80                     jButton0MouseMouseClicked(event);
 81                 }
 82             });
 83         }
 84         return jButton0;
 85     }
 86 
 87     private JRadioButton getJRadioButton0() {
 88         if (jRadioButton0 == null) {
 89             jRadioButton0 = new JRadioButton();
 90             jRadioButton0.setSelected(false);
 91             jRadioButton0.setText("定投");
 92             jRadioButton0.addMouseListener(new MouseAdapter() {
 93 
 94                 public void mouseClicked(MouseEvent event) {
 95                     jRadioButton0MouseMouseClicked(event);
 96                 }
 97             });
 98         }
 99         return jRadioButton0;
100     }
101 
102     private JComboBox getJComboBox1() {
103         if (jComboBox1 == null) {
104             jComboBox1 = new JComboBox();
105             jComboBox1.setModel(new DefaultComboBoxModel(new Object[] { "复利计算",
106                     "单利计算" }));
107             jComboBox1.setDoubleBuffered(false);
108             jComboBox1.setBorder(null);
109         }
110         return jComboBox1;
111     }
112 
113     private JComboBox getJComboBox0() {
114         if (jComboBox0 == null) {
115             jComboBox0 = new JComboBox();
116             jComboBox0.setModel(new DefaultComboBoxModel(new Object[] { "求本息和",
117                     "求本金", "求利率", "求年数 ", "求等额本息还款" }));
118             jComboBox0.setDoubleBuffered(false);
119             jComboBox0.setBorder(null);
120             jComboBox0.addMouseListener(new MouseAdapter() {
121             });
122         }
123         return jComboBox0;
124     }
125 
126     private JLabel getJLabel3() {
127         if (jLabel3 == null) {
128             jLabel3 = new JLabel();
129             jLabel3.setText("本息");
130         }
131         return jLabel3;
132     }
133 
134     private JLabel getJLabel2() {
135         if (jLabel2 == null) {
136             jLabel2 = new JLabel();
137             jLabel2.setText("年限");
138         }
139         return jLabel2;
140     }
141 
142     private JLabel getJLabel1() {
143         if (jLabel1 == null) {
144             jLabel1 = new JLabel();
145             jLabel1.setText("年利率");
146         }
147         return jLabel1;
148     }
149 
150     private JLabel getJLabel0() {
151         if (jLabel0 == null) {
152             jLabel0 = new JLabel();
153             jLabel0.setText("本金");
154         }
155         return jLabel0;
156     }
157 
158     private JTextField getJTextField3() {
159         if (jTextField3 == null) {
160             jTextField3 = new JTextField();
161         }
162         jTextField3.addKeyListener(new KeyAdapter() {
163             public void keyTyped(KeyEvent e) {
164 
165                 int keyChar = e.getKeyChar();
166                 if (keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9
167                         || keyChar == '.') {
168 
169                 } else {
170                     e.consume();
171 
172                 }
173             }
174         });
175         return jTextField3;
176     }
177 
178     private JTextField getJTextField2() {
179         if (jTextField2 == null) {
180             jTextField2 = new JTextField();
181         }
182         jTextField2.addKeyListener(new KeyAdapter() {
183             public void keyTyped(KeyEvent e) {
184 
185                 int keyChar = e.getKeyChar();
186                 if (keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9
187                         || keyChar == '.') {
188 
189                 } else {
190                     e.consume();
191 
192                 }
193             }
194         });
195         return jTextField2;
196     }
197 
198     private JTextField getJTextField1() {
199         if (jTextField1 == null) {
200             jTextField1 = new JTextField();
201         }
202         jTextField1.addKeyListener(new KeyAdapter() {
203             public void keyTyped(KeyEvent e) {
204 
205                 int keyChar = e.getKeyChar();
206                 if (keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9
207                         || keyChar == '.') {
208 
209                 } else {
210                     e.consume();
211 
212                 }
213             }
214         });
215         return jTextField1;
216     }
217 
218     private JTextField getJTextField0() {
219         if (jTextField0 == null) {
220             jTextField0 = new JTextField();
221             jTextField0.addKeyListener(new KeyAdapter() {
222                 public void keyTyped(KeyEvent e) {
223 
224                     int keyChar = e.getKeyChar();
225                     if (keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9
226                             || keyChar == '.') {
227 
228                     } else {
229                         e.consume();
230 
231                     }
232                 }
233             });
234         }
235         return jTextField0;
236     }
237 
238     private static void jiemian() {
239         try {
240             String lnfClassname = PREFERRED_LOOK_AND_FEEL;
241             if (lnfClassname == null)
242                 lnfClassname = UIManager.getCrossPlatformLookAndFeelClassName();
243             UIManager.setLookAndFeel(lnfClassname);
244         } catch (Exception e) {
245             System.err.println("Cannot install " + PREFERRED_LOOK_AND_FEEL
246                     + " on this platform:" + e.getMessage());
247         }
248     }
249 
250     boolean y = false;
251     String key2;
252     private JComboBox jComboBox0;
253 
254     private JRadioButton jRadioButton0;
255 
256     private JComboBox jComboBox1;
257 
258     private JButton jButton2;
259     private static final String PREFERRED_LOOK_AND_FEEL = "javax.swing.plaf.metal.MetalLookAndFeel";
260     public static void main(String[] args) {
261         jiemian();
262         SwingUtilities.invokeLater(new Runnable() {
263             public void run() {
264                 Fulijisuan frame = new Fulijisuan();
265                 frame.setDefaultCloseOperation(Fulijisuan.EXIT_ON_CLOSE);
266                 frame.setTitle("Fulijisuan");
267                 frame.getContentPane().setPreferredSize(frame.getSize());
268                 frame.pack();
269                 frame.setLocationRelativeTo(null);
270                 frame.setVisible(true);
271             }
272         });
273     }
274 
275     public void jButton0MouseMouseClicked(MouseEvent event) {
276         String key1;
277         boolean canplay = false;
278         String b, c, d;
279         double i = 0, n = 0, p = 0, f = 0;
280         key1 = (String) jComboBox0.getSelectedItem();
281         key2 = (String) jComboBox1.getSelectedItem();
282         if (key1 == "求本息和") {
283             b = String.valueOf(jTextField1.getText());
284             c = String.valueOf(jTextField2.getText());
285             d = String.valueOf(jTextField0.getText());
286             if (b.length() > 0 && c.length() > 0 && d.length() > 0) {
287                 i = Double.parseDouble(jTextField1.getText());
288                 n = Double.parseDouble(jTextField2.getText());
289                 p = Double.parseDouble(jTextField0.getText());
290                 canplay = deposit(i, n, p);
291             }
292 
293         } else if (key1 == "求本金") {
294             b = String.valueOf(jTextField1.getText());
295             c = String.valueOf(jTextField2.getText());
296             d = String.valueOf(jTextField3.getText());
297             if (b.length() > 0 && c.length() > 0 && d.length() > 0) {
298                 i = Double.parseDouble(jTextField1.getText());
299                 n = Double.parseDouble(jTextField2.getText());
300                 f = Double.parseDouble(jTextField3.getText());
301                 canplay = principal(i, n, f);
302             }
303         } else if (key1 == "求利率") {
304             b = String.valueOf(jTextField0.getText());
305             c = String.valueOf(jTextField2.getText());
306             d = String.valueOf(jTextField3.getText());
307             if (b.length() > 0 && c.length() > 0 && d.length() > 0) {
308                 p = Double.parseDouble(jTextField0.getText());
309                 n = Double.parseDouble(jTextField2.getText());
310                 f = Double.parseDouble(jTextField3.getText());
311                 canplay = interest(p, n, f);
312             }
313         } else if (key1 == "求年数 ") {
314             b = String.valueOf(jTextField0.getText());
315             c = String.valueOf(jTextField1.getText());
316             d = String.valueOf(jTextField3.getText());
317             if (b.length() > 0 && c.length() > 0 && d.length() > 0) {
318                 p = Double.parseDouble(jTextField0.getText());
319                 i = Double.parseDouble(jTextField1.getText());
320                 f = Double.parseDouble(jTextField3.getText());
321                 canplay = year(p, i, f);
322             }
323         } else if (key1 == "求等额本息还款") {
324             b = String.valueOf(jTextField0.getText());
325             c = String.valueOf(jTextField1.getText());
326             d = String.valueOf(jTextField2.getText());
327             if (b.length() > 0 && c.length() > 0 && d.length() > 0) {
328                 p = Double.parseDouble(jTextField0.getText());
329                 i = Double.parseDouble(jTextField1.getText());
330                 n = Double.parseDouble(jTextField2.getText());
331                 canplay = loan(p, i, n);
332             }
333         }
334         if (canplay == false) {
335             JOptionPane.showMessageDialog(null, "请输入正确的数字!");
336         }
337     }
338 
339     public void jButton1MouseMouseClicked(MouseEvent event) {
340         this.jTextField0.setText(null);
341         this.jTextField1.setText(null);
342         this.jTextField2.setText(null);
343         this.jTextField3.setText(null);
344     }
345 
346     public void jRadioButton0MouseMouseClicked(MouseEvent event) {
347         if (y == false)
348             y = true;
349         else
350             y = false;
351     }
352 
353     public boolean deposit(double i, double n, double p) {
354         double f = 0;
355         if (i > 0 && n > 0 && p > 0) {
356             if (n > 200)
357                 return false;
358             if (key2 == "复利计算") {
359                 if (y == true) {
360                     double p2 = p;
361                     for (int a = 0; a < n; a++) {
362                         p = p + f;
363                         f = p * (1 + i);
364                     }
365 
366                 } else {
367                     double s = 1;
368                     for (int a = 0; a < n; a++) {
369 
370                         s = s * (1 + i);
371                     }
372                     f = p * s;
373 
374                 }
375             } else {
376                 if (y == true) {
377 
378                     f = p * n *( i * n+ 1);
379                 } else {
380 
381                     f = p * (i * n + 1);
382                 }
383             }
384             this.jTextField3.setText(String.format("%.2f", f));
385             return true;
386         } else
387             return false;
388     }
389 
390     public boolean principal(double i, double n, double f) {
391         double p = 0, s = 1;
392         if (i > 0 && n > 0 && f > 0) {
393             if (n > 200)
394                 return false;
395             if (key2 == "复利计算") {
396                 for (int a = 0; a < n; a++) {
397                     s = (i + 1) * s;
398                 }
399                 p = f * (1 / s);
400 
401             } else {
402                 p = f * (1 / (1 + i * n));
403 
404             }
405             this.jTextField0.setText(String.format("%.2f", p));
406 
407             return true;
408         } else
409             return false;
410     }
411 
412     public boolean interest(double p, double n, double f) {
413         double i = 0;
414         if (f > 0 && n > 0 && p > 0) {
415             if (n > 200)
416                 return false;
417             if (key2 == "复利计算") {
418                 i = Math.pow(f / p, 1.0 / n) - 1;
419 
420             } else {
421                 i = (f - p) / (p * n);
422 
423             }
424             this.jTextField1.setText(String.format("%.2f", i));
425 
426             return true;
427         } else
428             return false;
429     }
430 
431     public boolean year(double p, double i, double f) {
432         double n = 0;
433 
434         if (i > 0 && f > 0 && p > 0) {
435             if (key2 == "复利计算") {
436                 n = Logarithm.log(f / p, 1 + i);
437 
438             } else {
439                 n = (f - p) / (p * i);
440 
441             }
442             this.jTextField2.setText(String.format("%.2f", n));
443             return true;
444         } else
445             return false;
446     }
447 
448     public boolean loan(double p, double i, double n) {
449         double f = 0;
450         if (n > 200)
451             return false;
452         if (i > 0 && n > 0 && p > 0) {
453             i = i / 12;
454             n = n * 12;
455             f = p * i * Math.pow(1 + i, n) / (Math.pow(1 + i, n) - 1);
456 
457             this.jTextField3.setText(String.format("%.2f", f));
458             return true;
459         } else
460             return false;
461 
462     }
463 }
1 public class Logarithm {
2     static public double log(double value, double base){
3         return Math.log(value)/Math.log(base);
4          
5      }
6 
7 }

六、运行结果

七、总结

由于和队友两人都对做界面不懂,需要向同学询问和网上查找相关资料,所以做出的界面不是很好并且只做了部分功能的界面。

转载于:https://www.cnblogs.com/xjy-gg/p/5393408.html

相关文章:

把简单做到极致

我真的还没有认真想过我已经是一名即将毕业的大三学生了。关于自己的过去&#xff0c;关于自己的未来。 有时候也有想过好好反思一下自己的过去&#xff0c;却发现自己的过去总是被太多的无奈与遗憾填满。有时候想畅想一下自己的未来&#xff0c;却发现未来总是充满了未知与迷茫…

作为程序员,要取得非凡成就需要记住的15件事。

作为程序员&#xff0c;要取得非凡成就需要记住的15件事。1、走一条不一样的路在有利于自己的市场中竞争&#xff0c;如果你满足于“泯然众人矣”&#xff0c;那恐怕就得跟那些低工资国家的程序员们同场竞技了。2、了解自己的公司以我在医院、咨询公司、物流企业以及大技术公司…

craigslist_Craigslist,Wikipedia和丰富经济

craigslistYou’ve heard it before. Maybe you’ve even said it. “There’s no such thing as a free lunch.”你以前听过 也许你甚至已经说过了。 “没有免费的午餐之类的东西。” “You can’t get something for nothing.”“你不能一无所获。” “Somebody has to pay…

EXCEL基础篇(二)

本章主要内容 一、单元格操作 二、插入批注 三、自动求和 四、填充序列 五、查找、替换 六、对齐方式 七、定位 八、插入形状及设置形状 九、页面设置 一单元格操作 1、插入 a、插入单元格 一个单元格选中状态---右击插入&#xff08;单元左右移&#xff09;--即可 b、插入单…

lua5.2调用c函数成功的例子

1. main.c-----------------//动态库#include <stdio.h>#include <stdlib.h>#include <string.h>#ifdef _cplusplusextern "C"{#endif#include <lua.h>#include <lauxlib.h>#include <lualib.h>static void checktoptype(lua_St…

【转】Android Activity原理以及其子类描述,androidactivity

Android Activity原理以及其子类描述&#xff0c;androidactivity 简介 Activity是Android应用程序组件&#xff0c;实现一个用户交互窗口&#xff0c;我们可以实现布局填充屏幕&#xff0c;也可以实现悬浮窗口。一个app由很多个Actvitiy组合而成&#xff0c;它们之间用intent-…

python 文件追加写入_Python写入文件–解释了打开,读取,追加和其他文件处理功能

python 文件追加写入欢迎 (Welcome) Hi! If you want to learn how to work with files in Python, then this article is for you. Working with files is an important skill that every Python developer should learn, so lets get started.嗨&#xff01; 如果您想学习如何…

带有中文的字符串各个字符的获取c++程序

简单易懂&#xff0c;上代码&#xff1a; #include <iostream> #include <cstring> #include <string> #include <cstdlib> #include <vector> using namespace std;class CStr{char *c;typedef struct {int start;bool isChinese;} counter;int…

C#时间格式化(Datetime)用法详解

Datetime.ToString(String, IFormatProvider) 参数format格式详细用法&#xff1a; 格式字符关联属性/说明dShortDatePatternDLongDatePatternf完整日期和时间&#xff08;长日期和短时间&#xff09;FFullDateTimePattern&#xff08;长日期和长时间&#xff09;g常规&#xf…

python添加数组元素_Python列表附录–如何向数组添加元素,并附带示例说明

python添加数组元素欢迎 (Welcome) Hi! If you want to learn how to use the append() method, then this article is for you. This is a powerful list method that you will definitely use in your Python projects.嗨&#xff01; 如果您想学习如何使用append()方法&…

学习进度条--第七周

第七周 所花时间&#xff08;包括上课时间&#xff09; 10小时&#xff08;包括上课2小时&#xff09; 代码量&#xff08;行&#xff09; 152 博客量&#xff08;篇&#xff09; 2篇&#xff08;包括团队博客&#xff09; 了解到的知识点 对组内开发的软件进行讨论&am…

Mybatis获取插入记录的自增长ID

转自&#xff1a;http://blog.csdn.net/tolcf/article/details/39035259 1.在Mybatis Mapper文件中添加属性“useGeneratedKeys”和“keyProperty”&#xff0c;其中keyProperty是Java对象的属性名&#xff0c;而不是表格的字段名。 <insert id"insert" parameter…

android中一种不支持的lua操作

今天写了一段lua代码&#xff0c;在win32中正常运行&#xff0c;在android中运行无效。 大概是这样的&#xff1a; ------file1.lua----- local t {} t.str "this is file1.t" return t ---------------------- -----file2.lua------ local t require &quo…

23岁一无所有怎么办_我搬到国外去创业,然后一无所有。

23岁一无所有怎么办以我的名字还不到一美元&#xff0c;它仍然感觉不像是最低点。 (With not even a dollar to my name, it still didn’t feel like rock bottom.) When you tell someone you’re working for a startup, they’ll either think you’re gonna be really ric…

正则表达式的基本入门

一、正则表达式基本语法 1. 两个特殊的符号‘^’和‘$’。他们的作用分别指出一个字符串的开始和结束。 2. 其他还有‘*’&#xff0c;‘’&#xff0c;‘&#xff1f;’这三个符号&#xff0c;表示一个或一序列字符重复出现的次数 "ab{2}" ---表示一个字符串有一个…

多继承中虚基类构造函数的一种调用规则

规则&#xff1a;如果父类中有虚基类(A)&#xff0c;且有一个直接基类(B)是虚基类的子类&#xff0c;那么子类(C或D)若不显式调用虚基类的有参数构造函数&#xff0c;它的直接基类(B)即使在构造列表中调用了非默认构造函数&#xff0c;那么也会直接调用虚基类的默认构造函数。 …

Android 常见异常及解决办法

前言 本文主要记录 Android 的常见异常及解决办法&#xff0c;以备以后遇到相同问题时可以快速解决。 1. java.lang.NullPointerException: Attempt to invoke virtual method void android.widget.TextView.setText(java.lang.CharSequence) on a null object reference 1) …

aws s3 静态网站_如何将静态网站或JAMstack应用托管并部署到AWS S3和CloudFront

aws s3 静态网站S3 and CloudFront are AWS cloud services that make serving static assets powerful and cheap. How can we host a simple static website or JAMstack app on it?S3和CloudFront是AWS云服务&#xff0c;使服务静态资产功能强大且价格便宜。 我们如何在其上…

图像预处理第7步:标准归一化

图像预处理第7步&#xff1a;标准归一化将分割出来的各个不同宽、高的数字字符宽、高统一 //图像预处理第7步&#xff1a;标准归一化 //将分割出来的各个不同宽、高的数字字符宽、高统一 void CChildView::OnImgprcStandarize() {StdDIBbyRect(m_hDIB,w_sample,h_sample);//在…

8. 进制转化的函数

一&#xff0c;表示进制的单词 bin&#xff1a;二进制 oct&#xff1a;八进制 dec&#xff1a;十进制 hex&#xff1a;十六进制二&#xff0c;四种进制的数据表示方式 $bin0b1010; //二进制数字写法&#xff08;暂时不学 &#xff09; …

二叉树广度优先遍历

#include <iostream> using namespace std;struct Node{//二叉树节点int value;Node *left;Node *right; };struct queue{//辅助队列int head;int tail;int len;//队列长度&#xff0c;遍历时用Node ** list;//队列内容void push(Node *n){list[tail] n;len;}Node * pop…

phaser.min.js_如何使用Phaser 3,Express和Socket.IO构建多人纸牌游戏

phaser.min.jsIm a tabletop game developer, and am continually looking for ways to digitize game experiences. In this tutorial, were going to build a multiplayer card game using Phaser 3, Express, and Socket.IO.我是桌面游戏开发人员&#xff0c;并且一直在寻找…

VirtualBox - RTR3InitEx failed with rc=-1912 (rc=-1912)

有一天重启电脑后虚拟机virtual box突然打不开了&#xff0c;提示类似 https://askubuntu.com/questions/900794/virtualbox-rtr3initex-failed-with-rc-1912-rc-1912 参考帖子中查看了一下包的情况dpkg --list virtualbox-* | grep ii 结果&#xff1a;ii virtualbox-dkms …

边工作边刷题:70天一遍leetcode: day 27

Permutation Sequence 原理&#xff1a;一个permutation是n位&#xff0c;在第i位的值取决于有多少个i-1位的组合。这i-1位的组合是在高位pick完之后剩下的数中 细节&#xff1a; 不同于decimal&#xff0c;位数是固定的&#xff0c;所以不能用k>0作为循环条件&#xff08;这…

基本数据结构(图: 基本结构,DFS,prim算法, kruskal算法)

#include <iostream> using namespace std; //约定&#xff1a; //1. 图是由很多节点(VERTEX)构成的, 因此图结构是由一个VERTEX的链表构成的, 每个VERTEX则需要有一个id,也就是start, 取start是为了跟LINE更直观地结合。 //2. 每个节点关联着很多(LINE)构成,因此每个VER…

gatsby_如何使用Gatsby和Leaflet创建夏季公路旅行地图绘制应用程序

gatsbyGet ready for the summer by building your own road trip mapping app with this step-by-step guide!通过此逐步指南&#xff0c;构建自己的公路旅行地图应用&#xff0c;为夏天做好准备&#xff01; What are we going to build? 我们要建造什么&#xff1f; What …

NEFU 1146 又见A+B

又见ab Problem:1146 Time Limit:1000ms Memory Limit:65535K Description 给定两个非负整数A,B,求他们的和。 Input 多组输入&#xff0c;每组输入两个非负整数A和B&#xff08;0<A,B<10^3000&#xff09;&#xff0c;可能会有前缀0&#xff0c;但保证总长度不超过3000…

图的最短路径dijkstra算法

想法是这样的&#xff1a; 1. 最开始要建立4个list&#xff0c;分别存储 a. 所有的Vertex: allVertex[] b. 一个空的Vertex list: emptyVertex[] c. 一个前缀表 previous list(用来回溯路径用): previous[] d. 一个表示最短距离的表(就是表示某个点与0点的最短距离)&#xff1…

JDBC数据源连接池(1)---DBCP

何为数据源呢&#xff1f;也就是数据的来源。我在前面的一篇文章《JDBC原生数据库连接》中&#xff0c;采用了mysql数据库&#xff0c;数据来源于mysql&#xff0c;那么mysql就是一种数据源。在实际工作中&#xff0c;除了mysql&#xff0c;往往还会有Oracle&#xff0c;sql se…

如果成为一名高级安卓开发_什么是高级开发人员,我如何成为一名开发人员?

如果成为一名高级安卓开发Becoming a Senior Developer is something many of us strive for as we continue our code journey and build our career. But what does it actually mean to be a "Senior" Developer?成为一名高级开发人员是我们许多人在继续我们的代…