高分求c语言的计算器源码,要求在dev环境下通过

来源:百度知道 编辑:UC知道 时间:2024/05/29 06:25:58
只需要能计算加减乘除就行,不过必须用c语言,最好用c语言比较简单的部分来写,如果在程序中加上中文注释的话,另外再送100分!
在双精度范围内,不需要什么图形界面,只要能输入一个式子,输出结果就行了,估计这个程序只需要不多于200行就行,

好好学习啊
连这个都搞不定
怎么做哥哥啊!?

需要多少位的数字进行加减乘除????

#include <stdlib.h>
#include <math.h>
#include <graphics.h>
#include <stdio.h>
#include <process.h>
#define EXCAPE 27
#define ENTER 13
main(){
int press,i,x,y,x1,y1,ch_z=0;
int dian=0;
char ch='0'; /*input + - * / */
char emp[80],sum[80],*e,*s;
double yuan=0.000000000000;
void init(void);
void clear_z(char *u);
double strtoflt(char *p);
int getkey();
int gd=DETECT, gm;
initgraph(&gd, &gm, "");
e=emp;
s=sum;
init();
x = (getmaxx() / 2) - 120;
y = (getmaxy() / 2) - 150;
x1 = (getmaxx() / 2) + 120;
y1 = (getmaxy() / 2) + 150;
while(1){
press = getkey();
switch(press){
case EXCAPE:
exit(0);
case 47:
bar (x + 10, y + 80 + 10, x + 60 - 10, y + 80 + 60 - 10);