22 lines
578 B
Text
22 lines
578 B
Text
Sub MostarPos(N As Integer) 'Mostrar fila y columna para el elemento
|
|
Dim M, I, R, C As Integer
|
|
Dim A As Integer[] = [1, 2, 5, 13, 57, 72, 89, 104] 'magic numbers
|
|
Dim B As Integer[] = [-1, 15, 25, 35, 72, 21, 58, 7]
|
|
I = 7
|
|
While A[I] > N
|
|
Dec I
|
|
Wend
|
|
M = N + B[I]
|
|
R = (M \ 18) + 1
|
|
C = (M Mod 18) + 1
|
|
Print "Atomic number "; Format(N, "###"); " -> "; R; ", "; C
|
|
End
|
|
|
|
Public Sub Main()
|
|
|
|
Dim Element As Integer[] = [1, 2, 29, 42, 57, 58, 59, 71, 72, 89, 90, 103, 113]
|
|
For e As Integer = 0 To 12
|
|
MostarPos(Element[e])
|
|
Next
|
|
|
|
End
|