当前位置:网站首页>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;
}边栏推荐
- Educational Codeforces Round 122 (Rated for Div. 2)
- It is forbidden to trigger onchange in antd upload beforeupload
- Study notes of Tutu - process
- China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
- (lightoj - 1369) answering queries (thinking)
- VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
- Research Report on market supply and demand and strategy of China's tetraacetylethylenediamine (TAED) industry
- Base dice (dynamic programming + matrix fast power)
- 第5章 消费者组详解
- MP4格式详解
猜你喜欢

Sublime text code formatting operation

提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)

OneForAll安装使用

It is forbidden to trigger onchange in antd upload beforeupload

Chapter 6 datanode

Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)

Cmake Express

ByteDance new programmer's growth secret: those glittering treasures mentors

两个礼拜速成软考中级软件设计师经验

新手必会的静态站点生成器——Gridsome
随机推荐
Li Kou leetcode 280 weekly match
Date plus 1 day
LeetCode 1447. Simplest fraction
Advancedinstaller installation package custom action open file
Click QT button to switch qlineedit focus (including code)
Remove the border when input is focused
Codeforces Round #802(Div. 2)A~D
Mp4 format details
Story of [Kun Jintong]: talk about Chinese character coding and common character sets
第三章 MapReduce框架原理
业务系统从Oracle迁移到openGauss数据库的简单记录
Audio and video development interview questions
China double brightening film (dbef) market trend report, technical dynamic innovation and market forecast
Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
Li Kou: the 81st biweekly match
QT implementation window gradually disappears qpropertyanimation+ progress bar
音视频开发面试题
Codeforces Round #799 (Div. 4)A~H
OneForAll安装使用
Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it