63. Packet Field ID or Value

 Your task is to define an enum class Kind with two enumerators Id and Value of type uint8_t.

After that, define a struct Packet with:

  • Kind kind
  • A union containing:
    • uint16_t id
    • int32_t value
       

The program will read a string ("Id" or "Value") and a number, store it in the correct union field, and then print it in the format:

 ID=<id>

VALUE=<value>

 

Example
 Input:

Id 42

Output:

ID=42

 

Input:

Value -10

Output:

VALUE=-10

 

Loading...

Input

Id 42

Expected Output

ID=42