当前位置:网站首页>The following program deletes n consecutive words starting from the ith character from the string str
The following program deletes n consecutive words starting from the ith character from the string str
2022-04-23 08:09:00 【laocooon】
#include <stdio.h>
#include <string.h>//string Turned out to be stdlib
void main()
{ char str[81];
int i,n;
printf(" Please enter the string str Value :\n");
scanf("%s",str);
printf(" The string you entered str yes :%s\n",str);
printf(" Please enter the deletion location i And the number of characters to be deleted n Value :\n");
scanf("%d%d",&i,&n);
while (i+n-1>strlen(str))
{ printf(" Delete location i And the number of characters to be deleted n The value of is wrong ! Please re-enter i and n Value \n");
scanf("%d%d",&i,&n);
}
while(str[i+n-1])//str[i+n]
{ str[i-1]=str[i+n-1];
i++;
}
str[i-1]='\0';//str[i]='\0';
printf(" The deleted string str yes :%s\n",str);
}
版权声明
本文为[laocooon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230638292684.html
边栏推荐
猜你喜欢

vivo,硬件安全的爱与雷霆
![[极客大挑战 2019]Havefun1](/img/8b/b15bf31771d54db25f24d630e64093.png)
[极客大挑战 2019]Havefun1

Feign source code analysis

雲計算技能大賽 -- openstack私有雲環境 第一部分

Three minutes to teach you to use Houdini fluid > > to solve particle fluid droplets
![云计算赛项--2020年赛题基础部分[任务3]](/img/a2/36ff5eafd18534207e6ab01422ea59.png)
云计算赛项--2020年赛题基础部分[任务3]

Analysis of Nacos source code

nacos源码分析思路

Intranet penetration series: dnscat2 of Intranet tunnel

Feign源码分析
随机推荐
Feign源码分析
Talking about distributed storage from ES, mongodb, redis and rocketmq
Hierarchical output binary tree
LeetCode 1611. 使整数变为 0 的最少操作次数
Asynchronous learning
upload-labs 靶场练习
Briefly describe the hierarchical strategy of memory
Ubuntu安装Mysql并查询平均成绩
MySQL——第一章节(MySQL中的数据类型)
Research on software security based on NLP (2)
Research on system and software security (5)
[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP
Research on software security based on NLP (I)
智能名片小程序名片详情页功能实现关键代码
Positioning of high precision welding manipulator
Intranet penetration series: dns2tcp of Intranet tunnel
vivo,硬件安全的爱与雷霆
在线YAML转XML工具
1216_MISRA_C规范学习笔记_控制流的规则要求
DVWA靶场练习