#include <stdio.h>
int main() {
int i;
int countn = 0, countc = 0, counte = 0;
char s[1024] = "abfv 21 f vfgreqgq21";
while (1) {
//printf("input message for check: ");
//gets(s);
for (i=0; s[i]!='\0'; i++) {
if (s[i] >= 48 && s[i] <= 57) {
countn++;
}
else if (s[i] >= 65 && s[i] <= 90) {
countc++;
}
else if (s[i] >= 97 && s[i] <= 122) {
countc++;
}
else if (s[i] == 32) {
counte++;
}
}
printf("count of number: %d\n", countn
); printf("count of character: %d\n", countc
); printf("count of empty(sapce): %d\n", counte
); break;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKCWludCBpOwoJaW50IGNvdW50biA9IDAsIGNvdW50YyA9IDAsIGNvdW50ZSA9IDA7CgoJY2hhciBzWzEwMjRdID0gImFiZnYgMjEgZiB2ZmdyZXFncTIxIjsKCXdoaWxlICgxKSB7CgkJLy9wcmludGYoImlucHV0IG1lc3NhZ2UgZm9yIGNoZWNrOiAiKTsKCQkvL2dldHMocyk7CgkJZm9yIChpPTA7IHNbaV0hPSdcMCc7IGkrKykgewoJCQlpZiAoc1tpXSA+PSA0OCAmJiBzW2ldIDw9IDU3KSB7CgkJCQljb3VudG4rKzsKCQkJfQoJCQllbHNlIGlmIChzW2ldID49IDY1ICYmIHNbaV0gPD0gOTApIHsKCQkJCWNvdW50YysrOwoJCQl9CgkJCWVsc2UgaWYgKHNbaV0gPj0gOTcgJiYgc1tpXSA8PSAxMjIpIHsKCQkJCWNvdW50YysrOwoJCQl9CgkJCWVsc2UgaWYgKHNbaV0gPT0gMzIpIHsKCQkJCWNvdW50ZSsrOwoJCQl9CgkJfQoJCXByaW50ZigiY291bnQgb2YgbnVtYmVyOiAlZFxuIiwgY291bnRuKTsKCQlwcmludGYoImNvdW50IG9mIGNoYXJhY3RlcjogJWRcbiIsIGNvdW50Yyk7CgkJcHJpbnRmKCJjb3VudCBvZiBlbXB0eShzYXBjZSk6ICVkXG4iLCBjb3VudGUpOwpicmVhazsKCX0KCglyZXR1cm4gMDsKfQ==