#include <stdio.h>
#include <string.h>
#define HEX_ARRAY "68 74 74 70 73 3a 2f 2f 77 65 63 68 61 74 76 32 2e 65 62 75 6c 6c 70 6f 77 65 72 2e 63 6f 6d 2f 75 73 65 72 2f 62 61 6c 61 6e 63 65 3f 63 6f 64 65 3d 30 32 31 75 57 51 30 30 30 66 4f 7a 64 51 31 55 41 70 30 30 30 50 71 57 33 70 30 75 57 51 30 46 26 73 74 61 74 65 3d"
int countHexNumbers(const char* input) {
int count = 0;
const char* delim = " ";
char* token;
char inputCopy[strlen(input) + 1];
strcpy(inputCopy, input);
token = strtok(inputCopy, delim);
while (token != NULL) {
int hexNumber;
if (sscanf(token, "%x", &hexNumber) == 1) {
count++;
}
token = strtok(NULL, delim);
}
return count;
}
int main() {
const char* input = HEX_ARRAY;
int count = countHexNumbers(input);
printf("输出结果:%02x\n", count);
return 0;
}