Задача: Square Every Digit
Запись от alhaos размещена 31.07.2021 в 18:00
(c) https://www.codewars.com/kata/... a88e000020 Welcome. In this kata, you are asked to square every digit of a number and concatenate them. For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1. Note: The function accepts an integer and returns an integer
Код:
811181 |
Всего комментариев 1
Комментарии
-
PowerShell 1
-join([Int32[]][Char[]]'9119').ForEach{[Math]::Pow($_-0x30,2)}
Запись от greg zakharov размещена 02.06.2023 в 00:16