Advertisement
veronikaaa86

4. Изписване на число до 9 с думи

Dec 23rd, 2021
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Sub Demo()
  2. Dim num As Integer
  3. num = 13
  4.  
  5. Dim digitAsText As String
  6. If num = 1 Then
  7. digitAsText = "one"
  8. ElseIf num = 2 Then
  9. digitAsText = "two"
  10. ElseIf num = 3 Then
  11. digitAsText = "three"
  12. ElseIf num = 4 Then
  13. digitAsText = "four"
  14. ElseIf num = 5 Then
  15. digitAsText = "five"
  16. ElseIf num = 6 Then
  17. digitAsText = "six"
  18. ElseIf num = 7 Then
  19. digitAsText = "seven"
  20. ElseIf num = 8 Then
  21. digitAsText = "eight"
  22. ElseIf num = 9 Then
  23. digitAsText = "nine"
  24. Else
  25. digitAsText = "not a digit"
  26. End If
  27.  
  28. Debug.Print digitAsText
  29.  
  30. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement