当前位置:网站首页>牛客小白月赛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 # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
- 26. Delete the duplicate item C solution in the ordered array
- DeFi生态NFT流动性挖矿系统开发搭建
- FPGA时序约束分享01_四大步骤简述
- 一文掌握数仓中auto analyze的使用
- Generate XML elements
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- 英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
- Lex and yacc based lexical analyzer + parser
- Shell programming core technology "I"
猜你喜欢

LeetCode第300场周赛(20220703)

用实际例子详细探究OpenCV的轮廓绘制函数drawContours()

Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?

读写关闭的channel是啥后果?

To sort out messy header files, I use include what you use

node_exporter部署

Oracle with as ora-00903: invalid table name multi report error

Bi skills - permission axis

BI技巧丨权限轴
redis分布式锁的8大坑总结梳理
随机推荐
Nebula Importer 数据导入实践
IBM WebSphere MQ retrieving messages
神经网络物联网应用技术学什么
使用canal配合rocketmq监听mysql的binlog日志
Summary and sorting of 8 pits of redis distributed lock
MySQL数据库基本操作-DDL | 黑马程序员
Using SSH
奥迪AUDI EDI INVOIC发票报文详解
2022养生展,健康展,北京大健康展,健康产业展11月举办
node_exporter部署
物联网应用技术的就业前景和现状
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
To sort out messy header files, I use include what you use
Technology sharing | interface testing value and system
prometheus安装
Cache é JSON uses JSON adapters
爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
Oracle with as ORA-00903: invalid table name 多表报错