1048写题记录 解题思路:简单输入然后进行切片注意事项:目前还不会在一行里面没有空格的输入多个数据,为了避免输入数据太多导致出错的情况,将输入的两个数字分别作为切片的开始和结束来人为限制输出的字符串长度。参考代码:n=int(input())a=input()m=int(input())print(a[m-1:n:1 题解列表 2022年06月06日 0 点赞 1 评论 667 浏览 评分:0.0
自定义函数之字符串拷贝的 简单解法 解题思路:本题的关键是找输出函数从那开始,数组的下标从0开始,所以从m开始实际在下标上是m-1,为了检验开头结尾,中间是否满足,带入试验,知满足。同时,不是在下标为n处停止,n是字符长度,第n个在下标上实际是n-1,但我只要用<号就行;注意事项:数组的下标从0开始, 题解列表 2022年06月18日 0 点赞 0 评论 505 浏览 评分:0.0
1048: [编程入门]自定义函数之字符串拷贝 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<string.h> int main() { char st[100],st2[100]; int n,m…… 题解列表 2022年06月20日 0 点赞 0 评论 511 浏览 评分:0.0
1048-自定义函数之字符串拷贝 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>using namespace std;string copy(int m,char a[]){ s…… 题解列表 2022年10月06日 0 点赞 0 评论 511 浏览 评分:0.0
自定义函数之字符串拷贝 #include#include#include#includeusingnamespacestd;voidfun(){chara[100],b[100];intn,m,i;cin>>n;for(i=0;i>a[i];}cin>>m;for(i=m-1;i 题解列表 2022年10月12日 0 点赞 0 评论 494 浏览 评分:0.0 初学者思维解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int a[1000]; int i,m,n,j; scanf("%d\n"…… 题解列表 2022年10月19日 0 点赞 0 评论 507 浏览 评分:0.0 字符串拷贝简易版 摘要:解题思路:输入一串字符串,然后直接从输入的m个字符中从第n个开始截断输出注意事项:注意数组是从0开始计数,所以第一个字符对应的数组下标为0参考代码:#include <stdio.h>int main…… 题解列表 2022年11月05日 0 点赞 0 评论 525 浏览 评分:0.0 一种超简单的方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,i; char str[100]; scanf("%d",&n); ge…… 题解列表 2022年11月27日 0 点赞 0 评论 445 浏览 评分:0.0 C语言 自定义函数之字符串拷贝& 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>#define Long 2int main(){ char* c[Long]; c…… 题解列表 2022年11月30日 0 点赞 0 评论 608 浏览 评分:0.0 getchar用法。。。 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,m; char str[100]; scanf("%d",&n); getchar(); get…… 题解列表 2022年12月03日 0 点赞 0 评论 485 浏览 评分:0.0 « 12...151617181920212223 »
初学者思维解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int a[1000]; int i,m,n,j; scanf("%d\n"…… 题解列表 2022年10月19日 0 点赞 0 评论 507 浏览 评分:0.0
字符串拷贝简易版 摘要:解题思路:输入一串字符串,然后直接从输入的m个字符中从第n个开始截断输出注意事项:注意数组是从0开始计数,所以第一个字符对应的数组下标为0参考代码:#include <stdio.h>int main…… 题解列表 2022年11月05日 0 点赞 0 评论 525 浏览 评分:0.0
一种超简单的方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,i; char str[100]; scanf("%d",&n); ge…… 题解列表 2022年11月27日 0 点赞 0 评论 445 浏览 评分:0.0
C语言 自定义函数之字符串拷贝& 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>#define Long 2int main(){ char* c[Long]; c…… 题解列表 2022年11月30日 0 点赞 0 评论 608 浏览 评分:0.0
getchar用法。。。 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,m; char str[100]; scanf("%d",&n); getchar(); get…… 题解列表 2022年12月03日 0 点赞 0 评论 485 浏览 评分:0.0