Guest User

Untitled

a guest
Jun 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. char *izbaci (char *string) {
  5. char *s=string;
  6. char *najduzi;
  7. int duzina;
  8. int broj;
  9. int max=0;
  10. while(*s!='\0') {
  11. duzina=0;
  12. broj=0;
  13. while(*s>='0' || *s<='9') {
  14. broj=broj*10+*s-'0';
  15. duzina++;
  16. s++;
  17. }
  18. if(broj>max) {
  19. max=broj;
  20. najduzi=s-duzina;
  21. }
  22. if (*s!='\0') s++;
  23. }
  24. if(max==0) return;
  25.  
  26. s=najduzi;
  27. while(*s>='0' || *s<='9') s++;
  28. while(*s!='\0') *najduzi++=*s++;
  29. *najduzi='\0';
  30.  
  31. return string;
  32. }
  33.  
  34. int main() {
  35. char a[]="ov33o je n196eka recenica";
  36.  
  37. printf("Nakon izbacivanja string je %s ",izbaci(a));
  38. return 0;
  39. }
Add Comment
Please, Sign In to add comment