摘要: 1. class Solution { public: bool isPowerOfTwo(int n) { if(n<=0) return false; while(n!=1) { if(n%2) return false; n/=2; } return true; } }; 2. 如果是2的倍数 阅读全文
posted @ 2020-06-27 18:13 qiujiejie 阅读(97) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/grandyang/p/4570699.html class Solution { public: int calculate(string s) { int sign=1,res=0,n=s.size(); stack<int> sta; for(i 阅读全文
posted @ 2020-06-27 17:54 qiujiejie 阅读(82) 评论(0) 推荐(0) 编辑