fork download
  1.  
  2. #include<iostream>
  3. #include<stdio.h>
  4. #include<conio.h>
  5. #include<stdlib.h>
  6. #include<string.h>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. char tmp[15];
  12. char str[15], csf[15] = { "E" };
  13. int ssm = 0, i, j, v, k, pos = 0, a;
  14.  
  15.  
  16. char pt[6][5][4] = { "" , "i" , "+" , "*" , "/",
  17. "E", "TX", "n" , "n" , "n",
  18. "X", "n" , "TX", "n" , "" ,
  19. "T", "VY", "n" , "n" , "n",
  20. "Y", "n" , "" , "VY", "" ,
  21. "V", "i" , "n" , "n" , "n" };
  22. cout << "\n Enter An Expression: " << endl;
  23. cin >> str;
  24.  
  25. while (str[ssm] != '/')
  26. {
  27. pos = 0;
  28. while (csf[pos] != 'E' &&
  29. csf[pos] != 'X' &&
  30. csf[pos] != 'T' &&
  31. csf[pos] != 'Y' &&
  32. csf[pos] != 'V' && csf[pos] != '\0')
  33. pos++;
  34. if (csf[pos] == '\0')
  35. break;
  36.  
  37. for (i = 1; i<6; i++)
  38. {
  39. if (csf[pos] == pt[i][0][0])
  40. break;
  41. }
  42. for (j = 1; j<5; j++)
  43. {
  44. if (str[ssm] == pt[0][j][0])
  45. break;
  46. }
  47. if (strcmp(pt[i][j], "n") == 0)
  48. {
  49. cout << "\n Null Value: " << endl;
  50. cout << pt[i][j];
  51. exit(0);
  52. }
  53.  
  54. for (k = 0; k<pos; k++)
  55. tmp[k] = csf[k];
  56. tmp[k] = '\0';
  57. strcat_s(tmp, pt[i][j]);
  58.  
  59. int l = strlen(tmp);
  60. k = l;
  61.  
  62. for (a = pos + 1; csf[a] != '\0'; a++, k++)
  63. tmp[k] = csf[a];
  64. strcpy_s(csf, tmp);
  65. }
  66.  
  67.  
  68. strcat_s(csf, "/");
  69. if (strcmp(csf, str) == 0)
  70. {
  71. cout << "\t csf" << csf;
  72.  
  73. cout << "\tstr" << str;
  74.  
  75. cout << "\n Valid Expression: " << endl;
  76.  
  77.  
  78. }
  79.  
  80. else
  81. {
  82. cout << "\n Invalid Expression:" << endl;
  83.  
  84. }
  85.  
  86.  
  87. _getch();
  88. return 0;
  89. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:18: fatal error: conio.h: No such file or directory
 #include<conio.h>
                  ^
compilation terminated.
stdout
Standard output is empty