Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BitsInverter
- {
- class Bits
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int step = int.Parse(Console.ReadLine());
- int index = 0;
- for (int i = 0; i < n; i++)
- {
- int numbers = int.Parse(Console.ReadLine());
- for (int j = 7; j >= 0; j--)
- {
- index++;
- if(step == 1 || index % step == 1)
- {
- numbers = numbers ^ (1 << j);
- }
- }
- Console.WriteLine(numbers);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment