C语言计算器代码
/*计算器为本人亲自编写,供大家交流学习。迷宫代码来自互联网,仅供娱乐*///-------------------------------------------------------------------//头文件#include using namespace std;#include#include #include #include #include#include//函数声明部分:
//------------------------------------------------------------------||// 计算器部分#define PI 3void welcome();void displayMenu();int JudgmentDouble( char ch[] ,int length );void panduan(char a[]);void mainfun();void Fun();double jiafa(double a,double b);double jianfa(double a,double b);double chengfa(double a,double b);double chufa(double a,double b);intqiuyu(int a,int b);double kaifang(double a);long jiecheng(int n);void maxgongyue(int m,int n);void mingongbeishu(int m,int n);double sinnum(double a);void qiujiefangcheng();void Migong();void team();//------------------------------------------------------------------||
//颜色声明部分
//------------------------------------------------------------------||void setcolor(unsigned short color){HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleTextAttribute(hCon,color);}//------------------------------------------------------------------||//------------------------------------------------------------------||//迷宫游戏,所有声明:
#define Height 23 //迷宫的高度,必须为奇数#define Width 39 //迷宫的宽度,必须为奇数 #define Wall 1#define Road 0#define Start 2#define End 3 #define Esc 5#define Up 1#define Down 2#define Left 3#define Right 4 int map[Height+2][Width+2]; void gotoxy(int x,int y) //移动坐标{ COORD coord; coord.X=x; coord.Y=y; SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), coord );}void hidden()//隐藏光标{ HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO cci;GetConsoleCursorInfo(hOut,&cci);cci.bVisible=0;//赋1为显示,赋0为隐藏SetConsoleCursorInfo(hOut,&cci);} void create(int x,int y) //随机生成迷宫{ int c[4][2]={0,1,1,0,0,-1,-1,0}; //四个方向 int i,j,t