The class Flags is already defined with a private 8-bit variable bits, a constructor, and a getter.
Flags
bits
Your task is to overload the bitwise NOT (~) operator so that applying ~flags returns a new Flags object with all 8 bits inverted.
~
~flags
In main():
main()
Input / Output Specification
Input:A single integer N such that 0 ≤ N ≤ 255
N
0 ≤ N ≤ 255
Output:Print the original input and the inverted value in the format:
Input=<input_value> Toggled Input=<toggled_value>
Example 1
Input:
0
Output:
Input=0 Toggled Input=255
Example 2
255
Input=255 Toggled Input=0
Example 3
170
Input=170 Toggled Input=85
Constraints
Test Cases
Test Results
Input
Expected Output