官术网_书友最值得收藏!

11. Primality testing

A prime number is an integer greater than 1 that has no factors other than 1 and itself. For example, 17 is prime because the only positive integers that you can multiply to get 17 are 1 and 17. In contrast, 21 is not prime because 3 × 7 = 21. Integers greater than 1 that are not prime are called composite numbers.

Write a program that determines whether an integer is prime or composite.

主站蜘蛛池模板: 鄂州市| 诸暨市| 遂昌县| 汕尾市| 昌宁县| 将乐县| 新蔡县| 微博| 尉犁县| 汨罗市| 喀喇沁旗| 太湖县| 岳阳市| 扬中市| 肥城市| 铁力市| 长海县| 金堂县| 嵊泗县| 广平县| 德清县| 盐源县| 鄂托克旗| 武陟县| 韩城市| 天柱县| 鲁山县| 东莞市| 耒阳市| 上林县| 涪陵区| 曲阳县| 昆明市| 噶尔县| 武穴市| 永清县| 安化县| 通河县| 广河县| 清原| 淮北市|