equ.cpp 660 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include <iostream.h>
  2. #include <stdio.h>
  3. #include "EQU.h"
  4. char order[4];
  5. char operators[10] = "*/+-";
  6. unsigned char text[256];
  7. struct equation{
  8. char type;
  9. void *item;
  10. } equation;
  11. void main()
  12. {
  13. order[0] = '*';
  14. order[1] = '/';
  15. order[2] = '+';
  16. order[3] = '-';
  17. printf("Input an equation:");
  18. getEquation();
  19. sortEquation();
  20. cout<< text;
  21. }
  22. void getEquation()
  23. {
  24. gets(text);
  25. return;
  26. }
  27. void sortEquation()
  28. {
  29. char *index;
  30. index = &text;
  31. while(*index != "\0")
  32. {
  33. index++;
  34. char place = strstr(operators,*index);
  35. if (place != null)
  36. {
  37. }
  38. }
  39. }
  40. void push()
  41. {
  42. }
  43. void * pop()
  44. {
  45. }