Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:请问为什么只有60种状态In Reply To:Re:请问为什么只有60种状态 Posted by:Idy002 at 2014-08-14 20:48:02 > 枚举+判断: > #include <iostream> > using namespace std; > bool isok( int c ) { > return !(c&(c<<1)||c&(c<<2)||c&(c>>1)||c&(c>>2)); > } > int main() { > int count=0; > for( int i=0; i<1024; i++ ) > count += isok(i); > cout<<count<<endl; > return 0; > } 赞 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator