当前位置:网站首页>7-7 ring the stupid bell
7-7 ring the stupid bell
2022-07-06 16:44:00 【HBUcs2020】
Topic link :PTA | Program design experiment auxiliary teaching platform
Mainly to investigate string Various uses of , The question is not difficult
// character string
// String search and replacement
#include<iostream>
using namespace std;
#include<string>
int main()
{
int n,pos1,pos2;
cin>>n;
getchar();
while(n--)
{
string s;
getline(cin,s);
pos1=s.find("ong,");
pos2=s.find("ong.");
if(pos1!=1&&pos2!=-1)
{
int count=0; // Record the number of spaces
int i;
for(i=s.length()-1; i>=0; i--)
{
if(s[i]==' ')
count++;
if(count==3)
break; // here i by ' ' The location of
}
s.replace(i,s.length()-i," qiao ben zhong");
cout<<s<<endl;
}
else
cout<<"Skipped"<<endl;
}
return 0;
}
边栏推荐
- Study notes of Tutu - process
- One hundred questions of image processing (11-20)
- Codeforces Round #799 (Div. 4)A~H
- Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)
- Audio and video development interview questions
- Raspberry pie 4B installation opencv3.4.0
- SQL quick start
- 300th weekly match - leetcode
- Basic principles of video compression coding and audio compression coding
- 第五章 Yarn资源调度器
猜你喜欢
CMake速成
Installation and configuration of MariaDB
视频压缩编码和音频压缩编码基本原理
Advancedinstaller installation package custom action open file
Chapter 6 rebalance details
Chapter 6 datanode
Kubernetes集群部署
The concept of spark independent cluster worker and executor
Ffmpeg command line use
LeetCode 1552. Magnetic force between two balls
随机推荐
Solve the single thread scheduling problem of intel12 generation core CPU (II)
Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
Kubernetes集群部署
Hbuilder X格式化快捷键设置
Install Jupiter notebook under Anaconda
Research Report on market supply and demand and strategy of double drum magnetic separator industry in China
Acwing - game 55 of the week
CMake Error: Could not create named generator Visual Studio 16 2019解决方法
简单尝试DeepFaceLab(DeepFake)的新AMP模型
js封装数组反转的方法--冯浩的博客
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
Summary of game theory
MP4格式详解
Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it
Problem - 922D、Robot Vacuum Cleaner - Codeforces
Discussion on QWidget code setting style sheet
The concept of spark independent cluster worker and executor
Codeforces Round #801 (Div. 2)A~C
Investigation report of bench type Brinell hardness tester industry - market status analysis and development prospect prediction
MariaDB的安装与配置