From 13bc96b11b45c5c0aa8eb331944061b29869b7a1 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Wed, 15 Jun 2022 09:35:00 +0800 Subject: [PATCH] ban function --- src/main/kotlin/Point24.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/Point24.kt b/src/main/kotlin/Point24.kt index 8cbe262..1581476 100644 --- a/src/main/kotlin/Point24.kt +++ b/src/main/kotlin/Point24.kt @@ -43,7 +43,9 @@ class Point24 { if (i < nums.size) nums.removeAt(i) else - throw IllegalArgumentException("不能使用未允许数值") + throw IllegalArgumentException("不能使用未得到的数值") + } else if (token.type == Token.TOKEN_FUNCTION.toInt()) { + throw IllegalArgumentException("禁止使用函数哦") } } if (nums.isNotEmpty())