Advertisement
Guest User

Untitled

a guest
Dec 26th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int wyrażenie (char*str)
  2. {
  3. int w,c,o;
  4. c=czynnik(str);
  5. if(c>0)
  6. {
  7. o=operacja(str+c);
  8. if ( o>0)
  9. {
  10. if ( (w=wyrażenie( str+c+1)) > 0) return c+o+w; //Tutaj musze podawać +2-+22 zamiast +2-22
  11. return c+o;
  12. }
  13. return c;
  14. }
  15. return 0;
  16. }
  17.  
  18. int czynnik(char*str)
  19. {
  20. int l,w;
  21. if((l=(liczba(str)))>0 ) return l;
  22. else if ((*str=='(') && ((w=(wyrażenie(str+1))) >0) && (((*str)+1)==')')) return w+2;
  23. return -1;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement