题解 | #进制转换#
进制转换
https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
#include <stdio.h>
int main() {
char hexString[20]; // Assuming maximum length of input is 20 characters
while (scanf("%s", hexString) != EOF) { // Keep reading input until end of file
unsigned int decimalValue;
sscanf(hexString, "%x", &decimalValue); // Convert hexadecimal input to decimal
printf("%u\n", decimalValue); // Print decimal output
}
return 0;
}