当前位置:网站首页>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;
}边栏推荐
- Basic principles of video compression coding and audio compression coding
- 音视频开发面试题
- Research Report on market supply and demand and strategy of China's four flat leadless (QFN) packaging industry
- Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
- Remove the border when input is focused
- Codeforces round 797 (Div. 3) no f
- LeetCode 1020. Number of enclaves
- Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)
- Date plus 1 day
- Study notes of Tutu - process
猜你喜欢

解决Intel12代酷睿CPU单线程只给小核运行的问题

Sublime text code formatting operation

Submit several problem records of spark application (sparklauncher with cluster deploy mode)

Ffmpeg command line use

Base dice (dynamic programming + matrix fast power)
![Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)](/img/92/9465a6c9f1ab88c4851a47fabe750c.jpg)
Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)

Chapter 1 overview of MapReduce

第7章 __consumer_offsets topic

Kubernetes cluster deployment

Oneforall installation and use
随机推荐
本地可视化工具连接阿里云centOS服务器的redis
图像处理一百题(11-20)
Market trend report, technical innovation and market forecast of double-sided foam tape in China
Codeforces round 797 (Div. 3) no f
LeetCode 1561. The maximum number of coins you can get
(lightoj - 1236) pairs forming LCM (prime unique decomposition theorem)
Codeforces Round #771 (Div. 2)
LeetCode 1636. Sort the array in ascending order by frequency
LeetCode 1020. Number of enclaves
Browser print margin, default / borderless, full 1 page A4
Spark independent cluster dynamic online and offline worker node
Li Kou leetcode 280 weekly match
QT implementation fillet window
Base dice (dynamic programming + matrix fast power)
Research Report on market supply and demand and strategy of Chinese table lamp industry
图像处理一百题(1-10)
QT style settings of qcobobox controls (rounded corners, drop-down boxes, up expansion, editable, internal layout, etc.)
视频压缩编码和音频压缩编码基本原理
第一章 MapReduce概述
Kubernetes cluster deployment