自定义函数之字符串拷贝 简单易懂
摘要:解题思路:切片注意事项:参考代码:m=int(input())x=input()n=int(input())d=x[n-1:]print(d)……
指针法巧解自定义函数之字符串拷贝
摘要:解题思路:1.先定义正常的n,m的值;2.定义一个变量i;3.定义一个指针指向a数组的首地址加上m - 1,也就是意味着p指针指向了a[m - 1];4.输出由指针p指向的字符串即可。注意事项:1.一……
自定义函数之字符串拷贝
摘要:解题思路:用切片很简单注意事项:参考代码:n = int(input())L = str(input())m = int(input())print(L[m-1:n])……
[编程入门]自定义函数之字符串拷贝(水题)
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,m,i; char s[100]; scanf("%d",&n); for(i=0;i<=n;i+……
LikeWater - 1048: [编程入门]自定义函数之字符串拷贝C++(两种解法,简单到再看一眼就会爆炸!)
摘要:##这是一个基本题目,还是与string字符串已经字符数组有关,解析如下↓⭐
*1、方法一,直接用string和它的处理函数substr*
**str.substr(n,m);//截取str字……
1048: [编程入门]自定义函数之字符串拷贝
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char str[100]; int n,m; scanf("%d",&n); scanf("%s",str);……
c++字符串简单解法
摘要:解题思路:注意事项:参考代码:#include<iostream> #include<algorithm>using namespace std;int main(){ int n,m; string……
strcpy?不不不,都多余了
摘要:```c
#include
int main()
{
int a,b;
char s[10000];
scanf("%d%s%d",&a,s,&b);
c……