數論

內容被吞…只能截圖了 數論基礎 (a+b)%c=((a%c)+(b%c))%c (a*b)%c=(a%c)*(b%c) 判斷素數: bool isprime(int x)//算法複雜度爲O(根號n) { if(x<=1) return false; for(int i=2;i<=sqrt(x+0.5);i++){ if(x%i==0) return false; } return true; }
相關文章
相關標籤/搜索