#include <stdlib.h> #include <string.h> #include <stdio.h> int countIntInInteger(char* input){ char* out; char* end = NULL; int value = strtol(input, &end, 10); out = malloc(value + strlen(input)); // could be shorter, but play it safe if(value == 0) { return value; } for (int i = 0; i != value; i++) { char c = end[i]; if (c > 96 && c < 123) // ascii a-z { c -= 32; } out[i] = c; } free(out); return value; } int main() { char test[1024]; scanf("%[^\n]%*c", test); countIntInInteger(test); return 0; }