64,281
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <bitset>
using namespace std;
template <size_t length>
class Test
{
private :
bitset <length> _bitset;
};
int main() {
Test<100> test;
return 0;
}
#include <iostream>
#include <bitset>
using namespace std;
template <size_t length>
class Test
{
private:
public:
bitset <length> _bitset;
bool next()
{
int n = _bitset.size() - 1;
while (n>=0&&_bitset[n]) _bitset[n--] = 0;
if (n<0) return false;
_bitset[n] = 1;
return true;
}
};
int main()
{
Test<5> test;
do cout << test._bitset << endl; while (test.next());
return 0;
}
#include <iostream>
#include <bitset>
using namespace std;
template <size_t length>
class Test
{
private:
public:
bitset <length> _bitset;
};
int main()
{
Test<5> test;
cout << test._bitset << endl;
return 0;
}
#include <iostream>
#include <bitset>
using namespace std;
template <size_t length>
class Test
{
private:
bitset <length> _bitset;
};
int main()
{
Test<5> test;
return 0;
}