当前位置:网站首页>1204 character deletion operation (2)
1204 character deletion operation (2)
2022-07-06 07:59:00 【Zhanglilong 666】
Title Description
Delete the string after the specified position character m Characters ( Include characters in the specified position ).
Input requirements
Enter two integer numbers in the first line n and m, Respectively represent the... Of the string n Characters ( Non subscript ) And to delete m Characters .
In the second line, enter the original string to be processed .
Output requirements
Output the processed string .
sample input
7 6 I love movie
sample output
I love
#include<cstdio>
#include<cstring>
int main()
{
char a[1006];
int len,i,sum=0,j=0,n,m;
scanf("%d%d\n",&n,&m);
gets(a);
len=strlen(a);
m=m-1;
n=n-1;
for(i=0;i<len;i++){
if(i<n||i>(m+n)){
printf("%c",a[i]);
}
}
printf("\n");
}
边栏推荐
- Basics of reptile - Scratch reptile
- Vit (vision transformer) principle and code elaboration
- Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
- Opencv learning notes 9 -- background modeling + optical flow estimation
- How to prevent Association in cross-border e-commerce multi account operations?
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Pangolin Library: control panel, control components, shortcut key settings
- Common functions for PHP to process strings
- Rust language - receive command line parameter instances
- edge瀏覽器 路徑獲得
猜你喜欢
How to prevent Association in cross-border e-commerce multi account operations?
解决方案:智慧工地智能巡檢方案視頻監控系統
Codeforces Global Round 19(A~D)
[redis] Introduction to NoSQL database and redis
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
Mex related learning
Qualitative risk analysis of Oracle project management system
A Closer Look at How Fine-tuning Changes BERT
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
随机推荐
flask返回文件下载
How to prevent Association in cross-border e-commerce multi account operations?
Key value judgment in the cycle of TS type gymnastics, as keyword use
将 NFT 设置为 ENS 个人资料头像的分步指南
Transformer principle and code elaboration
Risk planning and identification of Oracle project management system
Oracle time display adjustment
C # connect to SQLite database to read content
[Yugong series] creation of 009 unity object of U3D full stack class in February 2022
octomap averageNodeColor函数说明
数字经济时代,如何保障安全?
24. Query table data (basic)
C # create database connection object SQLite database
Position() function in XPath uses
2.10transfrom attribute
数据治理:元数据管理篇
Apache middleware vulnerability recurrence
onie支持pice硬盘
The Vice Minister of the Ministry of industry and information technology of "APEC industry +" of the national economic and information technology center led a team to Sichuan to investigate the operat
链表面试题(图文详解)