From b31787fe8345a8496968c95ea752a1c5253012c4 Mon Sep 17 00:00:00 2001 From: KleptsovKD Date: Mon, 3 Feb 2025 22:00:34 +0300 Subject: [PATCH] change nibble_in_hex --- lab04/main.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lab04/main.cpp b/lab04/main.cpp index 9c5f7a2..f38e88f 100644 --- a/lab04/main.cpp +++ b/lab04/main.cpp @@ -7,15 +7,7 @@ using namespace std; char nibble_to_hex(uint8_t i) //Conversion to hex format { assert(0x0 <= i && i <= 0xf); - //return "0123456789abcdef"[i]; - if (i < 10) - { - return i + '0'; - } - else - { - return 'a' + (i - 10); - } + return "0123456789abcdef"[i]; } void print_in_hex(uint8_t byte)