#!/usr/local/bin/tcc -run #include #include void dev_digit(char *s, char *c) { strcpy(s,c); int d = 0; do { if( *s >= '0' && *s <= '9') { d++; } else if (d > 0) { *(s - d) = *s; } } while(*c++); do { if( *c <= '0' && *c >= '9') { d++; } else if (d > 0) { *(c - d) = *c; } } while(*c++); } void changeS_letter(char *c) { int i,j=0; char *str; for(i=0;i<=j;i++){ if(*str>='A' && *str<='Z'){ str+='a'-'A'; }else if(*str>='a' && *str<='z'){ str-='a'-'A'; } } } int main(void) { int f,g; char *fuc; char *fng = "START"; char str[128]; char ctr[128]; do{ printf("*****If you want to START,please type START*****\n"); printf("*****If If you want to EXIT,please type EOF*****\n"); scanf("%s",fuc); strcmp(fng,fuc)==g; }while(g || (f=getchar())!=EOF); printf("Please input a string :"); scanf("%s",str); dev_digit(str,ctr); changeS_letter(ctr); printf("Result :\n"); printf("%s\n",str); printf("%s\n",ctr); return 0; }