当前位置:   article > 正文

C语言 | Leetcode C语言题解之第326题3的幂

C语言 | Leetcode C语言题解之第326题3的幂

题目:

题解:

  1. bool isPowerOfThree(int n){
  2. int count=0;
  3. while(n){
  4. count+=n%3;
  5. n/=3;
  6. }return count==1?true:false;
  7. }
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/946448
推荐阅读
相关标签
  

闽ICP备14008679号