Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <stdio.h>
- void scob ( char *s, int n);
- int main ()
- {
- int n;
- char s[20];
- gets (s);
- scob (s,n);
- puts (s);
- }
- void scob ( char *s, int n)
- {
- char *p, *q;
- p=s;
- while (*p != '/0')
- {
- if ( *p < '0' || *p > '9')
- {
- q = strchr (p, '\0');
- while ( q != (p-1))
- {
- *(q+1)=*q;
- q--;
- }
- strncpy (p, "(", 1);
- while (*p < '0' || *p > '9')
- {
- p++;
- }
- q = strchr (p, '\0');
- while (q != (p-1))
- {
- *(q+1)=*q;
- q--;
- }
- strncpy (p, ")",1);
- }
- p++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement