Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Threading;
- namespace scumbler
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] bits = new string[] { "10101011", "10101100", "10101101", "10101110", "10101111","10110001","10110010",
- "10110011", "10110100", "10110101", "10110110", "10110111", "10111000", "10111001", "10111010", "10111011"};
- for (int i = 0; i < bits.GetLength(0); i++)
- {
- string bit = bits[i];
- int numberOne = 0;
- Console.Write($"{i} Байт - {bit} || ");
- for (int j = 0; j < bit.Length - 1; j++)
- {
- if (bit[j] == '1')
- {
- numberOne++;
- }
- }
- if (numberOne % 2 == 0)
- {
- Console.Write("1\n");
- }
- else
- {
- Console.Write("0\n");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement