// 主程序
#include "tfunction.h" // 包含头文件"tfunction.h"
int main() // 主函数
{
char sxm; // 定义变量sxm为字符串类型
printf("请选择计算项目:\n");
printf("a:sin函数,b:cos函数,c:tan函数\n");
printf("d:反sin函数,e:反cos函数,f:反tan函数\n");
sxm=getchar(); // 从键盘输入一个字符
if (sxm=='a') // 判断输入的字符
{
sinjs(); // 调用函数:sinjs()
}
else if (sxm=='b')
{
cosjs();
}
else if (sxm=='c')
{
tanjs();
}
else if (sxm=='d')
{
asinjs();
}
else if (sxm=='e')
{
acosjs();
}
else if (sxm=='f')
{
atanjs();
}
else // 否则:
{
error(); // 调用error()函数
}
}
- 1
- 2
前往页