can anyone explain this code for checking is prime or not?

前端 未结 0 542
离开以前
离开以前 2021-01-28 10:41

// how this function checks if a number is prime or not

  bool isPrime(ll n){
      if(n == 2LL)
      return 1;
      if(n%2LL == 0LL)
      return 0;
      for(         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题