#include <stdio.h> #include <stdint.h> void classify_string(const char *str) { // Your logic here int i = 0; int stat = 0; while(str[i] != '\0') { if((str[i] >= 65 && str[i] <= 90) || (str[i] >= 97 && str[i] <= 122)) stat |= 1; else if(str[i] >= '0' && str[i] <= '9') stat |= 1 << 1; else stat |= 1 << 2; i++; } if(stat == 1) printf("ALPHABETIC"); else if(stat == 2) printf("NUMERIC"); else { if(stat) printf("MIXED"); } } int main() { char str[101]; fgets(str, sizeof(str), stdin); // Remove newline uint8_t i = 0; while (str[i]) { if (str[i] == '\n') { str[i] = '\0'; break; } i++; } classify_string(str); return 0; }
Test Cases
Test Results
Input
123456
Expected Output
NUMERIC