Checking if an int is prime more efficiently

前端 未结 11 786
暗喜
暗喜 2020-12-11 04:20

I recently was part of a small java programming competition at my school. My partner and I have just finished our first pure oop class and most of the questions were out of

11条回答
  •  庸人自扰
    2020-12-11 04:56

    @David get the square root of a number and then loop till square root eliminate even numbers and see if it is not divisble

提交回复
热议问题