本文介绍了电子配置逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个方法(Java)中找出电子配置的元素。

I am trying to create a method (in java) to figure out the Electron Configuration for an element.

例。
他(第二单元:2个电子)电子配置:1秒    
O(8元8个电子)电子配置:1秒 2秒 2P    
锆(40元40电子)电子配置:1秒 2秒 2P 3秒 3P 4S 3D 4P 5秒 4D

Ex.
He (2nd element: 2 electrons) Electron config: 1s
O (8th element 8 electrons) Electron config: 1s 2s 2p
Zr (40th element 40 electrons) Electron config: 1s 2s 2p 3s 3p 4s 3d 4p 5s 4d

我怎样才能找出逻辑来计算呢?当递增S,P,D和F壳,以及如图出标为每个壳

How can I figure out the logic to calculate this? When to increment the s, p, d, and f shells, as well as figure out the superscript for each shell.

的S 2电子MAX(2下标max)
6电子{P MAX(6下标max)
10电子ð最大(10标最大)
F最大的14电子(14标最大)

S max of 2 electrons (superscript max of 2)
P max of 6 electrons (superscript max of 6)
D max of 10 electrons (superscript max of 10)
F max of 14 electrons (superscript max of 14)

递归吧?

推荐答案

您可以创建一个类重present具有以下属性配置:

You may create a class for represent the configuration with the following attributes:

private final boolean[] K = new boolean[ 2];
private final boolean[] L = new boolean[ 8];
private final boolean[] M = new boolean[18];
private final boolean[] N = new boolean[32];
private final boolean[] O = new boolean[32];
private final boolean[] P = new boolean[32];

用于分配的地方,错误的一个自由的地方。

true for an allocated place, false for a free place.

实例钾:

K[0] = true;
K[1] = true;
L[0] = true;
...
L[7] = true;
M[0] = true;
...
M[7] = true;
N[0] = true;

这篇关于电子配置逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 15:48