当前位置:网站首页>牛客小白月赛7 F题
牛客小白月赛7 F题
2022-07-04 17:58:00 【相思明月楼】
题目描述
Bob在学习了DFS后,自己又发明了一种新的搜(luan)索(gao)方法,叫做BFS(Bobby First Search)。
这种搜索被定义为:在一个字符串中,从前向后查找第一个子串"Bob"出现的位置。(不区分大小写)
输入描述:
输入一个不含空格的字符串S(可能含有大小写字母,数字)。(1 ≤ |S| ≤ 100)
输出描述:
输出一个数字,表示"Bob"第一次出现的位置(下标从0开始)。 如果没有出现,则输出"-1"。
直接用JAVA中的Indexof,,,,
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String a = in.nextLine();
a = a.toLowerCase();
System.out.println(a.indexOf("bob"));
in.close();
}
}
边栏推荐
- Rookie post station management system based on C language
- Have you guys ever used CDC direct Mysql to Clickhouse
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
- Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
- Technology sharing | interface testing value and system
- 《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
- LeetCode FizzBuzz C#解答
- To sort out messy header files, I use include what you use
- The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
- 爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
猜你喜欢
一文掌握数仓中auto analyze的使用
使用canal配合rocketmq监听mysql的binlog日志
升级智能开关,“零火版”、“单火”接线方式差异有多大?
Detailed explanation of the binary processing function threshold() of opencv
Process of manually encrypt the mass-producing firmware and programming ESP devices
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
每日一题(2022-07-02)——最低加油次数
关于判断点是否位于轮廓内的一点思考
随机推荐
在线SQL转Excel(xls/xlsx)工具
Generate XML elements
Go microservice (II) - detailed introduction to protobuf
PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
LeetCode 赎金信 C#解答
Shell programming core technology "I"
Caché WebSocket
[release] a tool for testing WebService and database connection - dbtest v1.0
Nebula Importer 数据导入实践
删除字符串中出现次数最少的字符【JS,Map排序,正则】
One question per day (2022-07-02) - Minimum refueling times
IBM WebSphere MQ检索邮件
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
node_exporter部署
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
LeetCode第300场周赛(20220703)
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
神经网络物联网是什么意思通俗的解释
LM10丨余弦波动顺势网格策略
Technology sharing | interface testing value and system