当前位置:网站首页>牛客小白月赛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();
}
}
边栏推荐
- 2019年蜀山区第十五届青少年信息学竞赛
- Rookie post station management system based on C language
- Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
- 2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func
- 千万不要只学 Oracle、MySQL!
- 在线文本行固定长度填充工具
- 长城证券开户安全吗 买股票怎么开户
- 奥迪AUDI EDI INVOIC发票报文详解
- LM10丨余弦波动顺势网格策略
- 2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import 'fmt' func
猜你喜欢
One question per day (2022-07-02) - Minimum refueling times
联想首次详解绿色智城数字孪生平台 破解城市双碳升级难点
The 300th weekly match of leetcode (20220703)
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
自由小兵儿
BI技巧丨权限轴
Opencv functions and methods related to binary threshold processing are summarized for comparison and use
To sort out messy header files, I use include what you use
Build your own website (15)
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
随机推荐
[mathematical basis of machine learning] (I) linear algebra (Part 1 +)
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
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
Qt实现界面滑动切换效果
测试工程师如何“攻城”(下)
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
From automation to digital twins, what can Tupo do?
添加命名空间声明
整理混乱的头文件,我用include what you use
C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
如何使用Async-Awati异步任務處理代替BackgroundWorker?
Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
偏移量函数及开窗函数
Shell programming core technology II
Using FTP
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
876. Intermediate node of linked list
升级智能开关,“零火版”、“单火”接线方式差异有多大?