我做了兩個隨機數從0到3 a=0;
b=3;
A=round(a+(b-a)*rand(1,1000));
B=round(a+(b-a)*rand(1,1000));
然後我他們中的每兩位補充。然後我將其轉換爲二進制文件。 SUM = A + B;
binarySum = dec2bin(SUM);
,因爲我想算的轉變,我寫這樣的代碼: s = 1;
for i = 1:100
int main() {
int x = 3613;
std::cout << "x= " << x << std::endl;
std::string xBin = std::bitset<16>(x).to_string();
std::cout << xBin << std::endl;
unsigned long xDecimal = st