You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# include <iostream>
# include "addsubtract.hpp"
# include "muldivi.hpp"
# include "pow_coop_test.hpp"
# include "tri_func.hpp"
using namespace std ;
int main ( )
{
double x , y , result ;
int op ;
cout < < " 选择运算( 1加 2减 3乘 4除 5幂 6对数 7sin 8cos 9tan ) : " ;
cin > > op ;
cout < < " 输入两个操作数: " ;
cin > > x > > y ;
switch ( op )
{
case 1 :
result = add ( x , y ) ;
break ;
case 2 :
result = subtract ( x , y ) ;
break ;
case 3 :
result = mul ( x , y ) ;
break ;
case 4 :
result = divi ( x , y ) ;
break ;
case 5 :
result = power ( x , y ) ;
break ;
case 6 :
result = logarithm ( x , y ) ;
break ;
case 7 :
result = m_sin ( x , y ) ;
break ;
case 8 :
result = m_cos ( x , y ) ;
break ;
case 9 :
result = m_tan ( x , y ) ;
break ;
default :
cout < < " Error! 请选择正确的运算 \n " ;
break ;
}
cout < < " 结果为: " < < result ;
return 0 ;
}