021-bit operation 1 (keep it up), 021-bit keep
Given two 32-bit numbers, N and M, there are also two numbers of indication bits, I and j.
Write a program to make the value of the I-th to the j-th in N the same as that of M (that is, M becomes a substring of N and is located between the I-th and j-th in N)
Example:
Input: N = 10000000000, M = 10101, I = 2, j = 6
Output: N = 10001010100.
Solution:
First, we shift M left to vI bit to get the Mv;
Then we keep the 0-to-I bits of N: Si = N & (1 <I)-1)
Then we set all the 0-J bits of N to 0: N = (N> (J + 1) <(J + 1 );
Finally, we add up the above numbers.
int changeBit(int vN, int vM, int vI, int vJ){if (vI > vJ || vI > 31 || vJ > 31) return 0;int Move_M_I = vM<<vI;int Last_N_I = vN & ((1<<vI)-1);vN = (vN>>(vJ+1))<<(vJ+1);int Result = vN | Move_M_I | Last_N_I;}
English major 7Unit5 keep it up, xie lei Chinese student fitting in well Text Translation
7Unit5 keep it up, xie lei Chinese student fitting in well
Meaning of "keep it up and stay strong team" and "stay together team"
The CF radio is as follows:
Z key:
1. roger, affirmative -- understand.
2. Negative and Negative over out -- cannot be executed or executed.
3. Enemy spotted-discovers the Enemy.
4. Bomb spotted -- found the Bomb (C4 ).
5. sector clear -- the region is normal or the region is secure.
X key:
1. nice shot, good job-good gun method, good job.
2. keep going stay strong team-stick to the end.
3. follow me -- come with me.
4. cover me -- cover me.
5. keep front lines team-stick to the position.
C key:
1. A site -- A location.
2. B site -- B location.
3. Hold position-defense or guard.
4. stick together team-Keep team type.
5. storm the front-breakthrough.
The CS radio is as follows:
Z-key radio command:
1. Cover me -- Cover me.
2. You Take The Point-You hold this position.
3. Hold This Position each Unit maintains its current Position.
4. regroup team-re-TEAM up. This command can be used when teammates are too scattered.
5. Follow Me -- Follow Me.
6. taking fire -- shooting! Fire support is required.
X-key radio command
1. Go-team action/forward.
2. Fall Back-the entire team is withdrawn/withdrawn.
3. Stick together team-keep the entire team in action/maintain the formation.
4. Get in position and wait for my go -- the entire team is in place and cover me when I rush out.
5. Storm the front-the front of the entire team quickly burst into the front.
6. Report in -- ask the team members if they are ready to complete the return action.
C-key radio reply
1. Affirmative and Roget -- receive/understand.
2. Enemy Spotted-discovers the Enemy.
3. need backup-I need support.
4. Sector Clear -- regional security.
5. I'm in position -- I have located it.
6. Reporting In-Return Action preparation is complete.
7. She's gonna Blow! -- The bomb is about to explode!
8. Negative -- no.
9. enemy down-the ENEMY has been annihilated.