operand([问题描述] 一个算术表达式是由操作数(operand)、运算符(operator)和界限符(delimiter)组成的假设操作数)
![operand([问题描述] 一个算术表达式是由操作数(operand)、运算符(operator)和界限符(delimiter)组成的假设操作数)](/static/images/content_image/leaves-318743_1920.jpg)
本文目录
- [问题描述] 一个算术表达式是由操作数(operand)、运算符(operator)和界限符(delimiter)组成的假设操作数
- 汇编operand expected错误是怎么产生的
- 汇编语言operand must have size是什么意思
- c语言中operand是什么意思
- operant和operand区别~
[问题描述] 一个算术表达式是由操作数(operand)、运算符(operator)和界限符(delimiter)组成的假设操作数
#include 《stdio.h》
#include 《math.h》
enum state
;
int ctoi( char c)
bool isNum( char a)
bool isOp(char op)
{
switch(op)
{
case ’+’:
return true;
break;
case ’-’:
return true;
break;
case ’*’:
return true;
break;
case ’/’:
return true;
break;
default:
return false;
break;
}
}
bool isDot(char dot)
int checkString( char str, double *a, double * b, char* op, int num)
{
enum state s = BEGIN;
int a_i = 0;
int b_i = 0;
double num1 = 0;
double num2 = 0;
int pointNum = 0;
for( int i = 0; i 《 num; ++i)
{
if(str[i] == ’ ’)continue;
switch(s)
{
case BEGIN:
if(isNum(str[i]))
elses = ERROR;
break;
case P2:
if(isNum(str[i]))
else if(isDot(str[i]))
{
s = P3;
}
else if(isOp(str[i]))
{
*op = str[i];
s = P5;
}
else
s = ERROR;
break;
case P3:
if(isNum(str[i]))
{
num1 = num1 + ctoi(str[i]) * pow(0.1, ++pointNum) ;
s = P4;
}
else
s = ERROR;
break;
case P4:
if(isNum(str[i]))
{
num1 = num1 + ctoi(str[i]) * pow(0.1, ++pointNum);
s = P4;
}
else if(isOp(str[i]))
{
*op = str[i];
s = P5;
}
else
s = ERROR;
break;
case P5:
if(isNum(str[i]))
{
num2 = num2 * 10 + ctoi(str[i]);
s = P6;
}
else
s = ERROR;
break;
case P6:
pointNum = 0;
if(isNum(str[i]))
{
num2 = num2 * 10 + ctoi(str[i]);
s = P6;
}
else if(isDot(str[i]))
{
s = P7;
}
else
s = END;
break;
case P7:
if(isNum(str[i]))
{
num2 = num2 + ctoi(str[i]) * pow(0.1, ++pointNum);
s = P8;
}
else
s = END;
break;
case 8:
if(isNum(str[i]))
{
num2 = num2 + ctoi(str[i]) * pow(0.1, ++pointNum);
s = P8;
}
else if(isOp(str[i]))
{
s = END;
}
else
s = END;
break;
case ERROR:
printf(“express error. \n“);
break;
}
if (s == END || s == ERROR)
break;
}
if(s==END)
else
}
int main()
{
char op;
double a;
double b;
char string = ;
scanf(“%s“, &string);
printf(“the expression you input is : %s. \n“, string);
getchar();
if (-1 == checkString(string, &a, &b, &op, 128))
{
printf(“error occur while checking expression. Be sure no space in your expression when input\n“);
getchar();
return 0;
}
double result;
switch(op)
{
case ’+’:
result = a + b;
break;
case ’-’:
result = a - b;
break;
case ’*’:
result = a * b;
break;
case ’/’:
if(b != 0)
result = a / b;
else
{
printf(“ error! %d/%d“, a, b);
return -1;
}
break;
default:
printf(“undefined expression.\n“);
break;
}
printf(“%f %c %f = %f\n“, a, op, b, result);
return 0;
}
汇编operand expected错误是怎么产生的
有的指令要求有操作数,如add ax,bx,如果只写add或add ax,就因缺少操作数而不符合规则,于是operand expected——期望给操作数。
汇编语言operand must have size是什么意思
mov
[si+08h],’$’
;这句出现问题operand
must
have
size
这条传送指令,编译软件不能确定是8位数的,还是16位数的。
应该改成如下:
mov
BYTE
PTR
[si+08h],’$’
;说明是字节传送
另外,还有:WORD
PTR。说明是
字 传送。
c语言中operand是什么意思
1、操作数,运算数,the number on which an operation is to be done。
2、操作数在C语言中包括常量、标识符、字符串、函数调用、下标表达式、成员选择符和复杂表达式,在汇编语言中也是重要的一部分,通过将操作数与操作符相结合的方式或者通过将操作符放在括号内的方式形成。
operant和operand区别~
词汇来源于 服务科学理论
传统观点以产品主导逻辑(G-D Logic)为范式,以产品为中心,以价值的“交换价值”含义为基础。其中物质和自然资源等静态的有形资源称为对象性资源(operand resource),
服务主导逻辑(S-D Logic)认为所有的经济交换以服务为基础,产品只是资源传递和应用的工具。其中知识、技术和创新等动态的无形资源称之为操作性资源(operantr source)。
![operand([问题描述] 一个算术表达式是由操作数(operand)、运算符(operator)和界限符(delimiter)组成的假设操作数)](/static/images/content_image/woman-g8df7d756c_1280.jpg)
本文相关文章:
another time(another time和other time的区别)
2026年10月11日 05:00
cad二次开发用什么语言(cad二次开发,用lisp语言,image里面没有图像图形)
2026年9月4日 05:00
excel trim函数(excel 怎么批量删除前面的空格、小空格、替换查不到trim之类的函数也查不到但是能手动删除的那种)
2026年8月27日 12:00
attach importance to(用attach importance to造句)
2026年8月25日 13:40
datetimepicker赋值(c# 在指定日期与现在日期之间取随机日期,并赋值给datetimepicker)
2026年8月24日 23:00
sublime text3是干嘛的(兼容包sublime text 3是什么意思)
2026年8月6日 14:30
python decimal(python decimal计算)
2026年7月28日 05:40
primer软件(如何如何使用primer primer设计引物)
2026年7月13日 20:00
更多文章:
another time(another time和other time的区别)
2026年10月11日 05:00



