Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int length (char *s) {
- int d=0;
- while (*(s++)!='\0') d++;
- return d;
- }
- void cut(char *string, int indeks, int len)
- {
- int i;
- for(i = indeks; i <= length(string) - len; i++)
- {
- string[i] = string[i + len];
- }
- }
- int JeLiBroj (char c) {
- if (c>='0' && c<='9') return 1;
- return 0;
- }
- int JeLiSlovo (char c) {
- if (tolower(c)>='a' && tolower(c)<='z') return 1;
- return 0;
- }
- void Izbaci (char *s) {
- int i, duzina=length(s),poc,kraj;
- for (i=0; i<duzina; i++) {
- if (JeLiBroj(s[i]) && JeLiSlovo(s[i+1])) {
- poc=i;
- i++;
- while (JeLiSlovo(s[i])) i++;
- kraj=i;
- cut (s, poc, kraj-poc);
- i-=(kraj-poc);
- }
- }
- }
- int main () {
- char s[]="Selma 2je bila 3ovdje.";
- Izbaci(s);
- printf("%s", s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement