#include #define ENDIN 'Q' main() { int c, i, nwhite, nother, ndigit[10]; nwhite=nother=0; printf("Vnesi besedilo (za konec pritisni Q): "); for (i=0; i<10; ++i) ndigit[i]=0; while ((c=getchar())!=ENDIN) switch(c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': ndigit[c-'0']++; break; case ' ': nwhite++; break; case '\n': case '\t': nwhite++; break; default: nother++; break; }/* switch */ printf("digits ="); for(i=0; i<10; ++i) printf("%d ", ndigit[i]); printf("\nwhite space = %d, other = %d\n", nwhite, nother); }