pangfengliu / programmingtasks

programming tasks from my courses
67 stars 17 forks source link

File Mirroring and Shifting #355

Open littlehug opened 6 years ago

littlehug commented 6 years ago

Write a program to mirror and shift a binary file.

Task Description

Given the names of an input binary file of L bytes, the name for an output file and an integer N, mirror the file first, then shift the left N bytes and write the contents to the output binary file. For example, if a file consists of 00010011 01011100 00100110 11000101, after mirroring, it will be 10100011 01100100 00111010 11001000. Then we shift left 3 bytes, it will be 11001000 10100011 01100100 00111010.

Subtask