|
@@ -2,13 +2,17 @@
|
|
|
#include <string>
|
|
|
#include <cstdio>
|
|
|
#include <cmath>
|
|
|
+#include <cstring>
|
|
|
|
|
|
#include "cStack.h"
|
|
|
|
|
|
unsigned const int FIRST_MASS = 100;
|
|
|
using namespace std;
|
|
|
+
|
|
|
+using std::cout;
|
|
|
|
|
|
cStack cStack1;
|
|
|
+
|
|
|
void abstract ();
|
|
|
double get_number (char *mass);
|
|
|
|
|
@@ -18,18 +22,37 @@ double addition ();
|
|
|
double subtraction ();
|
|
|
|
|
|
int main () {
|
|
|
-
|
|
|
- abstract ();
|
|
|
|
|
|
while (true) {
|
|
|
|
|
|
- int Size_Ent_Comand = 0;
|
|
|
+
|
|
|
+ char comand[12];
|
|
|
+
|
|
|
+ double number = 0;
|
|
|
+
|
|
|
+ scanf( "%s%le", &comand, &number);
|
|
|
+
|
|
|
+ cout << "comand = " << comand << " number= " << number << endl;
|
|
|
+
|
|
|
+
|
|
|
+ char rrr[3][55] = {"pule","Ls", "CC"};
|
|
|
+
|
|
|
+ cout << "ewef " << rrr[0] << endl;
|
|
|
+
|
|
|
+ if (0 == strcmp(rrr[1], comand)) {
|
|
|
+ cout << "Its work \n";
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+
|
|
|
double number;
|
|
|
|
|
|
char mass[FIRST_MASS];
|
|
|
+
|
|
|
for (int i = 0; i < FIRST_MASS; i++ ) {
|
|
|
mass [i] = ' ';
|
|
|
}
|
|
|
+
|
|
|
gets(mass);
|
|
|
|
|
|
if (mass [0] == 'p' && mass [1] == 'u' && mass [2] == 's' && mass [3] == 'h' && mass [4] == ' ') {
|
|
@@ -84,10 +107,12 @@ int main () {
|
|
|
|
|
|
if (mass [0] == 'e' && mass [1] == 'n' && mass [2] == 'd') {
|
|
|
cout << "rezalt = " << cStack1.pop () << endl;
|
|
|
- goto metka1 ;
|
|
|
+ // goto metka1 ;
|
|
|
+ break;
|
|
|
}
|
|
|
+ */
|
|
|
}
|
|
|
- metka1:
|
|
|
+
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -123,16 +148,14 @@ double get_number (char *mass) {
|
|
|
return num;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
double cosine () {
|
|
|
|
|
|
- double rezalt = -999999;
|
|
|
- double element = 0;
|
|
|
-
|
|
|
- element = cStack1.pop ();
|
|
|
- cStack1.push (rezalt = cos (element) );
|
|
|
-
|
|
|
+ double result = cos (cStack1.pop ());
|
|
|
+ cStack1.push (result);
|
|
|
+
|
|
|
cout << "OK \n";
|
|
|
- return rezalt;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
double sinus () {
|