From b878af0ccfa1aad48a9efa1d72f2c4a1272a94f0 Mon Sep 17 00:00:00 2001 From: Liquor <31820325+stainedcreek@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:00:59 +0800 Subject: [PATCH] Update Time_Complexity.md Modify isPrime function --- website/content/ChapterOne/Time_Complexity.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/content/ChapterOne/Time_Complexity.md b/website/content/ChapterOne/Time_Complexity.md index e8cafc01b..b68708bb2 100644 --- a/website/content/ChapterOne/Time_Complexity.md +++ b/website/content/ChapterOne/Time_Complexity.md @@ -44,6 +44,7 @@ void hello (int n){ ```c bool isPrime (int n){ + if (num <= 1) return false; for( int x = 2 ; x * x <= n ; x ++ ) if( n % x == 0 ) return false;