Ահա իմ գրած հաշվիչը
Կոդ:
#include<iostream.h>
#include<math.h>
// ast = ( 180 / pi ) * rad
const double degress = 0.0174532925199432958 ; // 3.141926535897932384626433832795 / 180
double gumarum (double a , double b)
{
cout << "aha gumar@\t\t" << a + b << endl << endl ;
return 0 ;
}
double hanum (double a , double b)
{
cout << "aha tarberutyun@\t" << a - b << endl << endl ;
return 0 ;
}
double bazmapatkum (double a , double b)
{
cout << "aha artadryal@\t\t" << a * b << endl << endl ;
return 0 ;
}
double bazhanum (double a , double b)
{
cout << "aha qanord@\t\t" << a / b << endl << endl ;
return 0 ;
}
double sinus (double a)
{
cout << "aha sinus@\t\t" << sin(a * degress) << endl << endl ;
return 0;
}
double cosinus (double a)
{
cout << "aha sinus@\t\t" << cos(a * degress) << endl << endl ;
return 0;
}
double tangens (double a)
{
cout << "aha tangens@\t\t" << tan(a * degress) << endl << endl ;
return 0;
}
double logaritm (double a , double b)
{
cout << "aha logaritm@\t\t" << log(b) / log(a) << endl << endl ;
return 0 ;
}
double astichan (double a , double b)
{
cout << "aha ardyunq@\t\t" << pow(a,b) << endl << endl ;
return 0 ;
}
double armat (double a , double b)
{
cout << "aha ardyunq@\t\t" << pow(a,1/b) << endl << endl ;
return 0 ;
}
int bun ()
{
double a;
double b;
short int action ;
cout << "Mutqagrir hetevyal tiv@ hetevyal gortzoxutyan hamar" << endl ;
cout << "1\tgumarum" << " ||\t" <<"5\tsin" << " ||\t"<<" 9\tarmat"<<endl ;
cout << "2\thanum" << " ||\t" <<"6\tcos" << " ||\t"<<" 10\tastichan" << endl ;
cout << "3\tbazmapatkum" << " ||\t" <<"7\ttan" << endl ;
cout << "4\tbazhanum" << " ||\t" <<"8\tlog" <<endl ;
cin >> action ;
if ( action == 1 )
{
cout << "Mutqagrir erku tiv" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
gumarum(a,b);
}
if (action == 2 )
{
cout << "Mutqagrir erku tiv" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
hanum(a,b);
}
if (action == 3 )
{
cout << "Mutqagrir erku tiv" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
bazmapatkum(a,b);
}
if (action == 4 )
{
cout << "Mutqagrir erku tiv" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
bazhanum(a,b);
}
if (action == 5)
{
cout << "Mutqagrir mek tiv" << endl;
cout << "\t\t\t";
cin >> a ;
sinus(a);
}
if (action == 6)
{
cout << "Mutqagrir mek tiv" << endl;
cout << "\t\t\t";
cin >> a ;
cosinus(a);
}
if (action == 7 )
{
cout << "Mutqagrir mek tiv" << endl;
cout << "\t\t\t";
cin >> a ;
tangens(a);
}
if (action == 8 )
{
cout << "Mutqagrir himq@ ev tiv@" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
logaritm(a,b);
}
if (action == 9 )
{
cout << "Mutqagrir tiv@ ev astichan@" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
armat(a,b);
}
if (action == 10 )
{
cout << "Mutqagrir tiv@ ev astichan@" << endl;
cout << "\t\t\t";
cin >> a ;
cout << "\t\t\t";
cin >> b ;
astichan(a,b);
}
if ( action > 10 || action < 1 )
{
cout << "*>*>*>*>*>*>*>*>*>*>*>*>>>>>>>_____Sxal_____<<<<<<<*<*<*<*<*<*<*<*<*<*<*<*" << endl ;
}
return bun();
}
int main()
{
cout << "Barev , du bacel es Hrant-i tzragravoratz Hasvic@" << endl ;
bun () ;
return 0;
}
Ես նոր եմ սովորում :
Enipra դու որտեղ ես սովորել ?
Էջանիշներ