Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char *izbaci (char *string) {
- char *s=string;
- char *najduzi;
- int duzina;
- int broj;
- int max=0;
- while(*s!='\0') {
- duzina=0;
- broj=0;
- while(*s>='0' || *s<='9') {
- broj=broj*10+*s-'0';
- duzina++;
- s++;
- }
- if(broj>max) {
- max=broj;
- najduzi=s-duzina;
- }
- if (*s!='\0') s++;
- }
- if(max==0) return;
- s=najduzi;
- while(*s>='0' || *s<='9') s++;
- while(*s!='\0') *najduzi++=*s++;
- *najduzi='\0';
- return string;
- }
- int main() {
- char a[]="ov33o je n196eka recenica";
- printf("Nakon izbacivanja string je %s ",izbaci(a));
- return 0;
- }
Add Comment
Please, Sign In to add comment