All pastes #475239 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-07 10:20 UTC
rendered paste body
#include <stdio.h>

int ocisti(char *niz, int d);

int main()
{
   char niz[] = {'A', 'B', '!', '2', '.'};
   int d, i;
   d = ocisti(niz, 5);
   for (i = 0; i < d; i++) {
      printf("%c ", niz[i]);
   }
   getche();
   return 0;
}

int ocisti(char *niz, int d)
{
   int i, ret = 0;
   for (i = 0; i < d; i++) {
      if (*(niz + i) >= 'A' && *(niz + i) <= 'Z') {
         *(niz + ret) = *(niz +i);
         ret++;
      } else if (*(niz + i) >= '0' && *(niz + i) <= '9') {
         *(niz + ret) = *(niz +i);
         ret++;         
      }      
   }
   return ret;
}