当前位置:网站首页>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;
}
边栏推荐
- Double specific tyrosine phosphorylation regulated kinase 1A Industry Research Report - market status analysis and development prospect prediction
- Educational Codeforces Round 122 (Rated for Div. 2)
- Research Report on hearing health care equipment industry - market status analysis and development prospect prediction
- Hbuilder x format shortcut key settings
- Basic principles of video compression coding and audio compression coding
- LeetCode 1562. Find the latest group of size M
- 音视频开发面试题
- 第7章 __consumer_offsets topic
- Problem - 1646C. Factorials and Powers of Two - Codeforces
- 第5章 消费者组详解
猜你喜欢
Chapter 5 detailed explanation of consumer groups
Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it
图像处理一百题(1-10)
使用jq实现全选 反选 和全不选-冯浩的博客
解决Intel12代酷睿CPU单线程调度问题(二)
The concept of spark independent cluster worker and executor
提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
Soft music -js find the number of times that character appears in the string - Feng Hao's blog
Codeforces Round #802(Div. 2)A~D
随机推荐
Codeforces Round #800 (Div. 2)AC
Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
Tree of life (tree DP)
300th weekly match - leetcode
Spark's RDD (elastic distributed data set) returns a large result set
Chapter 5 detailed explanation of consumer groups
It is forbidden to trigger onchange in antd upload beforeupload
js封装数组反转的方法--冯浩的博客
Sublime text code formatting operation
【锟斤拷】的故事:谈谈汉字编码和常用字符集
Spark independent cluster dynamic online and offline worker node
使用jq实现全选 反选 和全不选-冯浩的博客
Chapter III principles of MapReduce framework
< li> dot style list style type
Li Kou leetcode 280 weekly match
Gridhome, a static site generator that novices must know
LeetCode 1020. Number of enclaves
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
QT style settings of qcobobox controls (rounded corners, drop-down boxes, up expansion, editable, internal layout, etc.)
ByteDance new programmer's growth secret: those glittering treasures mentors