顺序串的基本操作

Python--序列类型及运算---第1关:字符串基本操作 头歌 阅读详情

串说白了就是,元素是字符的线性表。这样一来就分为顺序存储和链式存储。
顺序存储我们用数组,加上当前表长。用一个结构体构造。

#include<iostream>
#include<stdio.h>
#define maxn 100
#define ERROR 0
#define OK 1//定义一些标志
typedef int Statue;//重命名 int,用bool也行,来标记函数运行是否成功
using namespace std;
typedef struct mystring//结构体定义
{
    char ch[maxn];
    int length=0;//当前表长
}Mystring;

存储写好了,我们先写创建(输入)。以#为结束符创建字符串。例,ABCDEF# 这样在屏幕上输入。

void create_Mystring(Mystring &s)//传的是引用型,这样,才能改变数组里的内容
{
    int i=0;
    char temp;
    cin>>temp;//输入字符
    while(temp!='#')//当输入不是#时,一直输入
    {
        s.ch[i]=temp;//赋值
        i++;
        s.length++;//非常重要的表长加一!!!!!!
        cin>>temp;//继续输入
    }
}

写完输入我们写输出,有了输入和输出才能调试其他的函数。

void print_Mystring(Mystring s)//输出类型,可以不用引用型,因为我们输出不要改变字符串
{
    int i;
    for(i=0;i<s.length;i++)//小于表长时,一直输出
        cout<<s.ch[i];
    cout<<endl;//输出换行
}

为了统一,我们写了一个获取字符串长度的函数,很简单的return。

int string_leng(Mystring s)
{
    return s.length;
}

接下来的操作我们写插入,我愿称为顺序表插入的增强版。顺序表的时候,我们只要插入一个元素,我们这是吧一个串插入到另一个串中。

Mystring string_insert(Mystring s,int index,Mystring temp)
{//注意参数,第一个是被插入的串,第二个是插入的起始位置,第三是插入的串
    int i;
    int temp_len=temp.length,s_len=s.length;//这个中间变量必须设,这代表原始串的长度。
    //如果不设,我们在下面的循环里,每次都改变串长,循环就停不下来了,后果很严重。
    for(i=s_len-1;i>=index-1;i--)//这个循环是把每个字符往后挪temp_len个位置,从后面开始挪
    {
        s.ch[i+temp_len]=s.ch[i];
    }
    //上面的循环结束后,我们就从index的位置,挪出来temp_len个位置。接下来把要插入的串挨个放进去,就大功告成了。
    for(i=0;i<temp_len;i++)
    {
         s.ch[i+index-1]=temp.ch[i];
         s.length++;//这个很重要!!!!!
    }
    return s;//这里返回一个结构体类型,所以函数定义的返回类型也应试Mystring
    //因为我们传不是引用型变量,所以,主函数调用,返回时,字符串s不变。想变就传引用型变量
}

第一插入的操作讲的比较详细,下面我讲的不会那么细了,基本操作都一样,就是,挪,往后挪就是插入,往前就是删除。
下面讲删除操作

Mystring string_delete(Mystring s,int start,int num)
{//要删除的字符串,起始位置,删除的个数
    int i,s_len=s.length,j=0;
    if(start+num>s_len)//从起始位置没有num个字符,即不够删的就全删
    //例如 ABCDEFG,从第五个删除5
    个,就是ABCD
        s.length=s_len-(s_len-start);
    else
    {
        for(i=start-1;i<s_len&&j<num;j++,i++)
        {
            s.ch[i]=s.ch[i+num];//从起始位置,要删除的元素,都被后面对应删除后的元素覆盖了,就是删除
            s.length--;//很重要!!!!!
        }
        for(;i<s_len-num;i++)
            s.ch[i]=s.ch[i+num];
    }
    return s;
}

替换操作:就是从起始位置,一个串替换原本这个串的元素。区别一下插入
例如:ABCDEF 插入 ZX 从2 得到 AZXBCDEF
而替换得到的就是AZXDEF

Mystring string_replace(Mystring s,Mystring s1,int start)
{
    int i,j=0;
    //这里,没有改变字符串长度,我们可以直接用s.lenght,来控制循环。
    for(i=start-1;i<s.length&&j<s1.length;i++,j++)
        //如果替换的开始位置靠后,不能,完全替换,我们的设计是不改变母串的长度,有多少替换多少
        s.ch[i]=s1.ch[j];
    return s;
}

**提取操作:**例ABCDEF 从 2 提取3个元素得BCD
这个返回值和参数类型稍微不一样,我们传一个布尔类型的,当成结果串。返回类型为void

void string_sub(Mystring s,Mystring &result,int start,int len)
{
    int i,j=0;
    result.length=0;
    for(i=start-1;i<start+len&&j<len;j++,i++)//如果切片的长度超过字符串的长度,让他全切下来
    {
        result.ch[j]=s.ch[i];
        result.length++;//!!!!!!!!!!!
    }
}

最后一个个操作有很简单,连接两个字符串
写的是,第二个参数接到第一个参数的后面。

Mystring string_connect(Mystring s,Mystring s1)
{
    int i,j=0;
    int s_len=s.length,s1_len=s1.length;
    for(i=s_len;i<s_len+s1_len&&s_len+j<maxn;j++,i++)
    {
        s.ch[i]=s1.ch[j];
        s.length++;
    }
    return s;
}

以上我们写完了,顺序串的几个重要操作,有些不足的地方是,我们没有去判断,参数的合法性,比如,插入时,起始位置是负数,或者超过当前的串的长度,中都是不合法的。所以当我们在主函数调用之前,可以写if else分支,先去判断一下。还有一种不合法,字符串连接之后超最大长度maxn,因为顺序从是固定长度。
下面延时在主函数如何调用这些函数(没有加非法判断)

int main()
{
    int length,index;
    Mystring s,s1,s2,s3;
    Mystring &temp=s;
    Mystring &temp1=s1;
    //输入
    create_Mystring(temp);
    create_Mystring(temp1);
    print_Mystring(s);
    //插入
    cin>>index;
    s2=string_insert(s,index,s1);
    print_Mystring(s2);
    //删除
    int start,del_len;
    cin>>start>>del_len;
    s2=string_delete(s,start,del_len);
    print_Mystring(s2);
    //替换
    cin>>start;
    s2=string_replace(s,s1,start);
    print_Mystring(s2);
    //提取
    cin>>start>>sub_len;
    string_sub(s,temp2,start,sub_len);
    print_Mystring(s3);
    //连接
    Mystring s4;
    s4=string_connect(s,s2);
    print_Mystring(s4);
}
详解顺序字符串 顺序串是采用顺序存储结构的字符串,又称为定长顺序串,是计算机科学技术名词,由零个或多个字符组成的有限序列。它通常采用字符型数组存放,是长度固定,且连续存放的串。 阅读详情

相关推荐

顺序栈的基本操作及应用

第1关:顺序栈的基本操作 本关任务是实现顺序栈的基本操作函数,以实现判断栈是否为满、是否为空、求栈元素个数、进栈和出栈等功能。 #include <stdio.h> #include<stdlib.h> #include <iostream> using namespace std; // 函数结果状态代码 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #

Junds0的博客 2124

顺序串的基本操作(C实现)

一、概念 顺序结构的存储空间都是事先定义的,顺序串也不例外,故也可成为 定长顺序串,它的存储类型是字符串的char类型。 二、具体实现 1.结构体定义 #include<stdio.h> #include<stdlib.h> #include<string.h> #define true 1 #define false 0 #define max 20 typedef struct { char data[max]; int length; }SString

m0_61395860的博客 7899

pta——特立独行的幸福

这是我认为比较复杂的一道题了,比较迷茫的点在于不知道要算各位平方和几次到不了1,才算他不是幸福数。突破口在于如果如果不是回到1也会有一些数字重复出现,只要重复出现的数字不是1,那就不是幸福数

m0_65620244的博客 4035

数据结构-串

目录 一、串的定义 1、串的定义 2、串的一些概念 二、串的存储结构 三、顺序串 1、顺序串定义 2、顺序串的基本运算 (1)代码部分 (2)结果演示 一、串的定义 1、串的定义 串是有零个或或多个字符组成的有限序列,又称为字符串。 一般记为:(n为正整数),str中串名,(1<=i<=n),由字母、数字和其他字符组成,n为串的长度。 2、串的一些概念 (1)空串:长度为零的串,称为空串,不含任意字符。 (2)子串:串中任意个连续的字符组成的子序列称为...

m0_50708613的博客 2744

【凌智视觉模块】rv1106 部署 pp-humseg 模型

人像分割技术实现摘要 人像分割是利用计算机视觉技术将图像/视频中的人物与背景分离的像素级处理技术。凌智视觉模块基于RV1106芯片开发,支持高效视觉模型部署。当前主流方法包括PP-HumanSeg、BiSeNet等深度学习模型,其中PP-HumanSegV2以96.63% mIoU精度和63FPS手机端速度成为SOTA方案。 实现流程包含: 初始化RKNN模型后端 图像预处理(尺寸调整、颜色空间转换) 执行模型推理 后处理(概率解码、动态阈值分割、形态学优化) 代码实现要点: 使用RKNPU2Backend

m0_50786932的博客 986

手把手教你用Kokoro-82M-v1.1-zh搭建本地TTS服务(含WebSocket接口)

本文详细介绍了如何使用Kokoro-82M-v1.1-zh模型搭建本地TTS服务,包括环境配置、模型部署、WebSocket接口实现及性能优化。通过实战指南,开发者可以快速掌握本地部署TTS系统的关键技术,提升语音交互应用的开发效率。

weixin_30776273的博客 183

数据结构之顺序串的基本操作(C语言)

----------------------✨🎉🎈==!!!热烈欢迎各位大佬!!!==🎈🎉✨---------------------- 🍹作者: BooleanChar12 ✨博客主页: BooleanChar12的博客 💘很喜欢的一句话: Because we all stand on the shoulders of giants. 🥂如有bug和疑惑欢迎大家与我🤺 😍觉得博主文章写的不错的话,希望大家三连(🎉关注,🎉点赞,🎉评论),多多支持一下!! -----------------------

永不秃头的George的博客 2648

如何使用AKShare作为OpenBB的数据源

`openbb_akshare`项目是 OpenBB 的数据源扩展。可以用于查询A股和港股数据

FinAnalyzer金融分析工具 3195

数据结构顺序串的基本操作(C/C++实现)

数据结构顺序串的基本操作(C/C++实现) 注意:本代码为了测试运行默认含有操作所需数据,如有需要可自己增删改相关数据 涉及基本运算流程 建立串 s = ‘’abcdefghijklnm’'和串s1 = ‘’xyz‘’ 输出串s 输出串s的长度 在串s的第9个字符位插入串s1而产生串s2 输出串s2 删除串s的第2个字符开始的5个字符而产生串s2 输出串s2 将串s的第2个字符开始的第5个字符替...

JunsIr的技术栈 1万+

Transformer-LSTM预测 | 基于Transformer-LSTM的多变量单步时间序列预测(Matlab)

Transformer-LSTM预测 | 基于Transformer-LSTM的多变量单步时间序列预测(Matlab)

机器学习之心的博客,关注并私信文章链接,获取对应文章源码和数据。 192

多源异构数据融合(Kaggle+Google Trends联合分析)

本文详细介绍了如何利用Python实现多源异构数据融合,以Kaggle电商销售数据与Google Trends搜索指数为例,展示了数据清洗、预处理、时间对齐、数据合并、相关性分析、回归建模和可视化全过程。数据预处理与内存优化通过分块加载、数据类型转换和缺失值处理,有效降低了大规模数据在内存中的占用,并确保数据质量。时间对齐与数据融合策略采用重采样与内连接方法对齐不同数据源的时间维度,实现了高质量数据的融合,为后续联合分析奠定基础。模型构建与分析。

闲人编程的博客 1016

数据结构-顺序串的基本操作

//顺序串的基本操作 #include #include using namespace std; #define max 50 typedef struct { char data[max]; int length; }sqstring; void display(sqstring s)//输出串 { int i; if(s.length>0) for(i=0;i<s.length;

西风的博客 3725

Sigrity System Explorer Transient Analysis模式进行瞬态仿真分析操作指导-单端信号-串联端接

Sigrity System Explorer Transient Analysis模式可以用于瞬态仿真分析,通过搭建简易拓扑用于前仿真分析通道的时域性能,下面搭建一个简易的单端拓扑并且进行串联端接,以下图为例,准备好发送接收端的IBIS模型, (se_example.ibs,本例发送接收端都使用相同的IBIS模型),以及传输线的S参数模型(W1_welement_se.sp)最上方的图形界面是传输线的模型,本例是一个上下都有参考平面的带状线,右侧的梯形是蚀刻角度,根据W1和W2以及铜厚来确定。

weixin_54787054的博客 338

C语言实现顺序串基本操作

C语言实现顺序串基本操作 通过调用简单函数实现顺序串的相关操作,其中大部分操作其实都可以通过string.h中的函数实现,所以这里的操作仅供理解。代码编译环境为VS2019 16.10.0。因为VS的某些原因,scanf写为了scanf_s,作用是一样的,在其他编译环境中可将scanf_s改回去。 #include<stdio.h> //输入输出头文件 #include<stdlib.h> //标准库头文件 #include<stdbool.h> //C语言布尔类型

Zhangjf的博客 2480

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C语言:顺序串基本操作

顺序串基本操作 定长顺序串类型定义 typedef struct{ char ch[MAXLEN]; int len; }SString; 顺序串的初始化 void InitString(SString *s) { gets_s(s->ch); s->len = strlen(s->ch); } 顺序串插入操作 int StrInsert(SString *s,int pos,SString t) { //在串s中下为pos的字符之前插入串t int i; //插入位置不

快乐修勾的博客 2158

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

第四章 串、数组和广义表 —— 顺序串的基本操作

顺序串的基本操作 #include<bits/stdc++.h> #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define MAXSTRLEN 255 typedef int Status; typedef int ElemType; typedef unsigne...

Deam_swan_goose的博客 328

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

基于C语言实现的顺序串的基本操作(录入、插入、删除、比较、简单模式匹配)

基于C语言实现的顺序串的基本操作 #include <stdio.h> #define MAXSIZE 40 //结构体 typedef struct { char ch[MAXSIZE]; int len; }SString; //输入s串 void creat1(SString *s){ int i; printf("请输入顺序串s的长度len:"); ...

weixin_46561483的博客 3757

(数据结构)(C++)顺序串的建立和部分基本操作

【代码】(数据结构)(C++)顺序串的建立和部分基本操作。

陈阿炳的博客 566

串的基本知识,顺序串和链串的基本操作

顺序串的基本操作 #include<iostream> using namespace std; const int MaxSize = 50; typedef struct { char data[MaxSize] = {"\n"};//在这里把串初始化为换行结束符,结尾就不会出现很多烫字了 int length;//讲实话为什么这样初始化一个“\n''还是不太清楚 }SqString; //输入字符串生成串 void StrAssign(SqString& s, char cst

龙龙龙 432

数据结构与算法:顺序串基本操作

#include "iostream"using namespace std;#define MaxSize 100typedef struct{ char data[MaxSize]; int length;}SqString;void Assign(SqString &amp;s,char str[]){ int i=0; while(str[i]!='\0'){ s.data[i]=str...

qq_37828633的博客 724

顺序串基本操作

#include #define MaxSize 100 //最多的字符个数 typedef struct { char data[MaxSize]; //定义可容纳MaxSize个字符的空间 int length; //标记当前实际串长 } SqString; void StrAssign(SqString &s,char cstr[])

靡不有初鲜克有终 6073

python顺序_python-顺序串基本操作的实现

1 #*********************************************************************** **2 #> File Name: seqstring.py3 #> Author: 邹庭荣4 #> Mail: 1198875194@qq.com5 #> Created Time: 2020年11月0...

weixin_32148861的博客 959
上一篇: 蓝桥开发板(CT107D)学习记录————12.串口通信
下一篇: 链串的基本操作
玛莱之盾
博客等级 码龄7年 43粉丝 78原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值