Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include<string.h>
  3.  
  4.  
  5. int main()
  6. {
  7. int val;
  8. char c []="13.2x+12y";
  9. char*p=c;
  10.  
  11. while(*p){
  12.  
  13. if( isdigit(*p)||((*p=='-'||*p=='+') && isdigit(*(p+1)) )){
  14. long val=strtol(p, &p,10);
  15. printf("%ldn", val);
  16.  
  17. }else{
  18. p++;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement