当前位置:网站首页>牛客小白月赛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();
}
}
边栏推荐
- C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
- Oracle with as ora-00903: invalid table name multi report error
- 数组中的第K个最大元素
- 2019年蜀山区第十五届青少年信息学竞赛
- Nebula importer data import practice
- Other InterSystems%net tools
- 整理混乱的头文件,我用include what you use
- 关于判断点是否位于轮廓内的一点思考
- 神经网络物联网应用技术就业前景【欢迎补充】
- 1672. Total assets of the richest customers
猜你喜欢
使用canal配合rocketmq监听mysql的binlog日志
Rookie post station management system based on C language
Bi skills - permission axis
自由小兵儿
读写关闭的channel是啥后果?
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
DeFi生态NFT流动性挖矿系统开发搭建
Oracle with as ora-00903: invalid table name multi report error
Go microservice (II) - detailed introduction to protobuf
在线SQL转Excel(xls/xlsx)工具
随机推荐
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
Oracle with as ora-00903: invalid table name multi report error
Lex and yacc based lexical analyzer + parser
如何使用Async-Awati异步任務處理代替BackgroundWorker?
ftp、sftp文件传输
IBM WebSphere MQ retrieving messages
爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
在线文本行固定长度填充工具
神经网络物联网是什么意思通俗的解释
Other InterSystems%net tools
Technology sharing | interface testing value and system
《工作、消费主义和新穷人》的微信读书笔记
Wireshark网络抓包
Rookie post station management system based on C language
Technologie de base de la programmation Shell IV
模板_判断素数_开方 / 六素数法
876. 链表的中间结点
建立自己的网站(15)
repeat_P1002 [NOIP2002 普及组] 过河卒_dp