From 44f9d4b8e63d4f7f1b447744124e95f22c8ce296 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Wed, 2 Aug 2017 10:44:26 +0700 Subject: Add others/other/{colorec.pas,gc.go,prodig.go} --- others/other/prodig.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 others/other/prodig.go (limited to 'others/other/prodig.go') 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) + } + } +} -- cgit 1.4.1