diff options
Diffstat (limited to 'others/other/prodig.go')
-rw-r--r-- | others/other/prodig.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/others/other/prodig.go b/others/other/prodig.go new file mode 100644 index 0000000..e269ee1 --- /dev/null +++ b/others/other/prodig.go @@ -0,0 +1,23 @@ +package main + +import "fmt" + +func main() { + var T, N int + fmt.Scan(&T) + for ; T > 0; T-- { + var s string + fmt.Scan(&N) + for i := 9; i > 1; i-- { + for N%i == 0 { + N /= i + s = fmt.Sprint(i) + s + } + } + if len(s) > 0 { + println(s) + } else { + println(1) + } + } +} |