Форум » C/C++ для начинающих (C/C++ for beginners) » -64 bit table » Ответить

-64 bit table

ramees: how can i generate 64 bit table . i know its a big table but this is for a research (one time use only ) [pre2] #include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { vector<string> A; vector<string> B; A.push_back("0"); A.push_back("1"); // create 64 bit table for (int i = 0; i < 64; i++) { for (int y = 0; y < 2; y++) { for (int x = 0; x < A.size(); x++) { if (y == 0) { B.push_back("0" + A[x]); } else { B.push_back("1" + A[x]); } } } A = B; B.clear(); } return 0; } [/pre2]-

Ответов - 2

ramees: for(uint64_t i = 0; i < 68719476737;i++){ bitset<32> bit(i); } i found a way

Сыроежка: Do not use magic numbers like 68719476737 It is unclear what it means.



полная версия страницы