コード例 #1
0
ファイル: problem55.go プロジェクト: mjwestcott/projecteuler
// reversed returns a new *big.Int with reversed digits.
func reversed(n *big.Int) *big.Int {
	a := n.String()
	b := tools.ReversedString(a)
	c, _ := new(big.Int).SetString(b, 10)
	return c
}
コード例 #2
0
ファイル: problem55.go プロジェクト: mjwestcott/projecteuler
// isPalindrome checks whether the given *big.Int is a palindrome.
func isPalindrome(n *big.Int) bool {
	a := n.String()
	b := tools.ReversedString(a)
	return a == b
}