Home > Software engineering >  How do I to an integer by compression BCD code into an array of arrays and will be deposited in the
How do I to an integer by compression BCD code into an array of arrays and will be deposited in the

Time:09-16

How do I to an integer by compression BCD code into an array of arrays and will be deposited in the compression BCD back into an integer

Num=1234567 deposit such as integer array after a (4)

There are two ways to

A (0)=& amp; H01-2
A (1)=& amp; H23
A (2)=& amp; H45
A (3)=& amp; H67

Or

A (0)=& amp; H67
A (1)=& amp; H45
A (2)=& amp; H23
A (3)=& amp; H01-2

Could you tell me how to implement the above functional requirement

CodePudding user response:

refer to the original poster eisldkw response:
could you tell me how to turn a into an array of integers by compression BCD code and will be stored in an array of compression BCD code back into an integer

Num=1234567 deposit such as integer array after a (4)

There are two ways to

A (0)=& amp; H01-2
A (1)=& amp; H23
A (2)=& amp; H45
A (3)=& amp; H67

Or

A (0)=& amp; H67
A (1)=& amp; H45
A (2)=& amp; H23
A (3)=& amp; H01-2

Could you tell me how to implement the above functional requirement


Moderators, we this how is so weak, please moderator to answer it

CodePudding user response:

A (0)=& amp; H01-2
A (1)=& amp; H23
A (2)=& amp; H45
A (3)=& amp; H67

It is
Value=https://bbs.csdn.net/topics/a (0) * 1000000 * 10000 + a + a (1) (2) * 100 + a (3)

Compression is
Value=https://bbs.csdn.net/topics/12345678
For I=3 to 0 step - 1
A (I)=value mod 100
Value=HTTP://https://bbs.csdn.net/topics/value/100
Next

Another way of thinking, don't write,
  • Related