随笔分类 -  Math

摘要:Math 质数 【试除法判定质数】 质数和合数是针对所有大于1的 “自然数” 来定义的 所有小于等于1的整数既不是质数也不是合数. bool is_prime(int x){ if(x<2)return false; for(int i=2;i<n/i;i++){ if(n%i==0)return 阅读全文
posted @ 2022-10-19 23:32 Dengpc 阅读(45) 评论(0) 推荐(0)