소스 검색

Implement the return function

DricomDragon 5 년 전
부모
커밋
562ecb93fb
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      hpal.hs

+ 6 - 1
hpal.hs

@@ -1,4 +1,9 @@
-r _ = 1
+r n = rconcat n 0
+
+rconcat inv outv  =
+	if inv == 0
+	then outv
+	else rconcat (div inv 10) (outv * 10 + mod inv 10)
 
 ispal n = r n == n