2864: 单词替换(python)
摘要:解题思路:注意事项:参考代码:#注意去掉前导后导空格
#先把字符串转为列表,直接用replace会有问题(比如句子中的want可能ant会被替换)
s = list(input().strip()……
正则表达式--study||O.o
摘要:注意事项:题目有问题,测试样例并不全是英文单词,还有特殊符号!!!参考代码:import java.util.Scanner;
public class Main
{ public stat……
2864: 单词替换 STL版
摘要:解题思路:注意事项:参考代码:#include <iostream>
#include <sstream>
// #include <cstdio>
// #include <algorithm……
用“字符的二维数组”
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n = 0; char a[105][105……
2864: 单词替换
摘要:```cpp
#include
#include
using namespace std;
int main()
{
int n=0;
char s[101][101];……
2864: 单词替换
摘要:解题思路:1.读入一行字符串s、待替换单词a和替换单词b。2.使用stringstream将字符串s分割成单词,并依次判断每个单词是否为待替换单词a,若是,则输出替换单词b;否则输出原单词。3.输出替……