#include //打开库文件#include #include #include #include #include #define error 0#define ok 1typedef struct{ int *base; int *top; int stacksize;}sqstack; class CExpression{public: CExpression(); ~CExpression();public: void initstack(sqstack &s); int ge
Assembly code DATAS SEGMENT cap1 db "please input a string",0dh,0ah,"$" cap2 db "plesae input the letter you search",0dh,0ah,"$" str0 db 40,?,40 dup(0), str1 db 40 dup (0) DATAS ENDS STACKS SEGMENT dw 40h dup(?) STACKS ENDS CODES SEGMENT ASSUME CS:C
如下所示:
str_1='wo shi yi zhi da da niu '
char_1='i'
nPos=str_1.index(char_1)
print(nPos)
运行结果:7
========是使用find==========
str_1='wo shi yi zhi da da niu '
char_1='i'
nPos=str_1.find(char_1)
print(nPos)
结果:5
========如何查找所有‘i’在字符串中位置呢?===========
#开