当前位置:网站首页>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;
}边栏推荐
- ffmpeg命令行使用
- Double specific tyrosine phosphorylation regulated kinase 1A Industry Research Report - market status analysis and development prospect prediction
- LeetCode 1566. Repeat the pattern with length m at least k times
- Chapter 6 rebalance details
- LeetCode 1447. Simplest fraction
- Codeforces round 797 (Div. 3) no f
- 第5章 NameNode和SecondaryNameNode
- 第一章 MapReduce概述
- Raspberry pie 4B installation opencv3.4.0
- Li Kou leetcode 280 weekly match
猜你喜欢

(lightoj - 1323) billiard balls (thinking)

Soft music -js find the number of times that character appears in the string - Feng Hao's blog

Summary of game theory

Raspberry pie 4B installation opencv3.4.0

Install Jupiter notebook under Anaconda

Detailed explanation of FLV format

LeetCode 1560. The sector with the most passes on the circular track

Installation and configuration of MariaDB

< li> dot style list style type

简单尝试DeepFaceLab(DeepFake)的新AMP模型
随机推荐
业务系统从Oracle迁移到openGauss数据库的简单记录
Codeforces Round #802(Div. 2)A~D
原生js实现全选和反选的功能 --冯浩的博客
Spark的RDD(弹性分布式数据集)返回大结果集
业务系统兼容数据库Oracle/PostgreSQL(openGauss)/MySQL的琐事
Submit several problem records of spark application (sparklauncher with cluster deploy mode)
Li Kou leetcode 280 weekly match
Discussion on QWidget code setting style sheet
Calculate the time difference
Kubernetes集群部署
Spark独立集群动态上线下线Worker节点
China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
Market trend report, technical innovation and market forecast of China's desktop capacitance meter
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
Research Report of desktop clinical chemical analyzer industry - market status analysis and development prospect prediction
Research Report on market supply and demand and strategy of China's four seasons tent industry
软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客
Chapter III principles of MapReduce framework
Study notes of Tutu - process
OneForAll安装使用