首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
while
[编程题]while
热度指数:1167
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
小歪找到了一个由五个字符构成的字符串,它一次可以选择任意一个字符,将其修改为另一个字符,他想要知道,将这个字符串修改为
需要的最少操作次数。
输入描述:
输入一个长度为
,由小写字母构成的字符串
。
输出描述:
输出一个整数,表示将字符串
修改为
需要的最少操作次数。
示例1
输入
while
输出
0
示例2
输入
wlill
输出
2
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(3)
分享
纠错
提交结果有问题?
4个回答
9篇题解
开通博客
Leavery
发表于 2025-04-28 14:32:08
补完题 发一下个人题解 A 模拟 #include <iostream> using namespace std; int main() { string s, t = "while"; cin>>s; int cnt = 0; for (int i=0;
展开全文
可爱抱抱呀😥
发表于 2025-04-28 22:33:39
D~F Java题解,代码已去除冗余~~~ D 数组4.0 容易观察到,连续至少两种数字的集合,点与点之间可以相互到达,因为可以利用相邻的数字作为桥;连续一种数字,则需要组内数字连边至少成树;;而以上的组之间需要至少连边成树,时间复杂度(Tnlogn) import java.util.*; pub
展开全文
shanzhi7
发表于 2025-05-01 04:04:29
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; vector a; vector pre; unordered_map<int, int> me; int root(int x)
展开全文
shanzhi7
发表于 2025-05-01 04:06:01
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; vector<int> a; v
展开全文
牛客732405425号
发表于 2025-12-14 16:22:07
n=input() b=['w','h','i','l','e'] count=0 for i in range(5): if n[i] not in b[i]: count+=1 print(count)
涂图被offer砸中
发表于 2026-01-16 01:17:32
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner sc =
展开全文
_苏格拉底_
发表于 2025-11-25 20:59:05
#include<iostream> using namespace std; int main(){ string s; cin >> s; int times=0; if(s[0]!='w')times++; if(s[1]!='h
展开全文
霜山雨迟
发表于 2026-01-29 14:37:38
#include <iostream> #include <string> using namespace std; int main() { string s1; cin >> s1; string s2 = "whil
展开全文
While1729
发表于 2025-11-20 22:51:32
#include <stdio.h> #include<string.h> int main() { char target[]="while"; char input[6]; scanf("%5s",input
展开全文
问题信息
难度:
4条回答
3收藏
185浏览
热门推荐
相关试题
躲藏
动态规划
评论
(5)
Dropout是一种深度学习训练中...
深度学习
评论
(1)
下列哪些情况可能会导致数据库索引失效?
数据库
评论
(1)
下面关于C++中的虚函数(virt...
C++
评论
(1)
关于 Dropout 技术在神经网...
深度学习
评论
(1)
while
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
while
0
wlill
2