Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature may not be available in some browsers.
Function Pir_Cifre(n1, Optional n2, Optional n3, Optional n4, Optional n5)
Dim Vet_Numeri(5): Dim Vet_Cifre(10)
Vet_Numeri(1) = n1: Vet_Numeri(2) = n2: Vet_Numeri(3) = n3: Vet_Numeri(4) = n4: Vet_Numeri(5) = n5
conta = 0
For k = 1 To 5
If Not IsMissing(Vet_Numeri(k)) Then
Select Case Vet_Numeri(k)
Case 0: conta = conta
Case 1 To 9
conta = conta + 1
Vet_Cifre(conta) = Vet_Numeri(k)
Case 10 To 90
conta = conta + 1
Vet_Cifre(conta) = Left(Vet_Numeri(k), 1)
conta = conta + 1
Vet_Cifre(conta) = Right(Vet_Numeri(k), 1)
End Select
End If
Next k
If conta = 0 Then Pir_Cifre = 0
If conta = 1 Then Pir_Cifre = Vet_Cifre(conta)
If conta > 1 Then
Num_linee_pir = conta - 1
ReDim Vet_linee(Num_linee_pir, conta)
For k = 1 To conta
Vet_linee(Num_linee_pir, k) = Vet_Cifre(k)
Next k
For Linea = Num_linee_pir - 1 To 1 Step -1
For num = 1 To Linea + 1
Vet_linee(Linea, num) = (Vet_linee(Linea + 1, num) + Vet_linee(Linea + 1, num + 1)) Mod 9
Next num
Next Linea
Pir_Cifre = (Vet_linee(1, 1) * 10 + Vet_linee(1, 2)) Mod 90
If Pir_Cifre = 0 Then Pir_Cifre = 90
End If
End Function