当前位置:网站首页>牛客小白月赛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();
}
}
边栏推荐
- Unity adds a function case similar to editor extension to its script, the use of ContextMenu
- Shell programming core technology II
- node_exporter部署
- 物联网应用技术的就业前景和现状
- How test engineers "attack the city" (Part 2)
- 2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
- Technology sharing | interface testing value and system
- “只跑一趟”,小区装维任务主动推荐探索
- Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
- How test engineers "attack the city" (Part I)
猜你喜欢
MySQL数据库基本操作-DDL | 黑马程序员
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
Oracle with as ORA-00903: invalid table name 多表报错
“只跑一趟”,小区装维任务主动推荐探索
BI技巧丨权限轴
神经网络物联网应用技术就业前景【欢迎补充】
Pytorch学习(四)
关于判断点是否位于轮廓内的一点思考
Process of manually encrypt the mass-producing firmware and programming ESP devices
建立自己的网站(15)
随机推荐
小发猫物联网平台搭建与应用模型
Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
Lm10 cosine wave homeopathic grid strategy
Shell 編程核心技術《四》
Wireshark网络抓包
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
物联网应用技术的就业前景和现状
A method of using tree LSTM reinforcement learning for connection sequence selection
Unity editor extends C to traverse all pictures in folders and subdirectories
876. Intermediate node of linked list
DeFi生态NFT流动性挖矿系统开发搭建
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
26. Delete the duplicate item C solution in the ordered array
从实时应用角度谈通信总线仲裁机制和网络流控
Unity adds a function case similar to editor extension to its script, the use of ContextMenu
Qt实现界面滑动切换效果
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
Go微服务(二)——Protobuf详细入门
自由小兵儿