Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void max_broj(char *s){
  5.  
  6. char *p=s ;
  7. char *pm,*km*,*kt,*pt*,*z ,*pi,*ci;
  8. int broj=0 ; max=0 ;
  9.  
  10. while(*p!='\0') {
  11.  
  12. if(*p<='9'&& *p>='0') && (p==s || *(p+1)=='\0')
  13. { pt=p ;
  14. while (*p<='9'&& *p>='0' ) p++ ;
  15. if(*p==' ' || *p=='\0')
  16. {
  17. kt=p ;
  18. z=kt-1 ;
  19. while(z>pt){
  20. broj=broj+(*z-'0')*k ;
  21. k*=10 ;
  22. z-- ; }
  23. if(broj>max) {max=broj ; pm=pt ; km=kt ; }
  24.  
  25.  
  26. }
  27. }
  28. else p++ ; }
  29. pi=pm ; ci=km ;
  30. while(*ci!='\0')
  31. {
  32. *pi=*ci ; pi++ ; ci++ ;
  33. *pi='\0' ;
  34.  
  35. }
  36.  
  37.  
  38. }
  39.  
  40.  
  41. int main () {
  42.  
  43. char niz[100]="Adna je 69 ,saro ,96" ;
  44.  
  45. max_broj(niz) ;
  46.  
  47. printf("%s",niz) ;
  48. return 0 ; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement