1083: Hello, world! 摘要:直接用 %c 输出 ASCII 码对应的字符,注意读入换行符时输出空格。#include <bits/stdc++.h> using namespace std; int main() { …… 题解列表 2021年12月23日 0 点赞 0 评论 558 浏览 评分:0.0
1093: 字符逆序 摘要:直接用 reverse 函数将字符串逆序。#include <bits/stdc++.h> using namespace std; int main() { string s; …… 题解列表 2021年12月23日 0 点赞 0 评论 626 浏览 评分:0.0
1126: C语言训练-字符串正反连接 摘要:使用 reverse 函数将字符串反序。#include<bits/stdc++.h> using namespace std; int main(){ string s,temp;…… 题解列表 2021年12月23日 0 点赞 0 评论 647 浏览 评分:0.0
1206: 字符串问题 摘要:这题就是字符串逆序,使用 reverse 函数。#include<bits/stdc++.h> using namespace std; int main(){ string s; …… 题解列表 2021年12月23日 0 点赞 0 评论 613 浏览 评分:0.0
1687: 数据结构-字符串连接 摘要:#include<bits/stdc++.h> using namespace std; int main(){ string a,b; while(cin>>a>>b){ …… 题解列表 2021年12月23日 0 点赞 0 评论 596 浏览 评分:0.0
入门]自定义函数之数字后移 解题思路:解题思路:其实重点就再最后一条printf语句中的取余哪里,其余的读入数据就不多说了,通过for循环读入即可;来看一下这个运算符%的魅力吧。inta[10]={1,2,3,4,5,6,7,8,9,0};对于上面的数组如何让它循环右移3位呢;通常的做法的是再创建一个数组;把后3位先读入新数组中 题解列表 2021年12月23日 0 点赞 0 评论 717 浏览 评分:0.0
divmod(x, y)函数,集商和余数于一体 #a,b=divmod(x,y)divmod()函数会返回两个值,第一个为x//y,第二个返回值为x%yMoneyVariety_lis=[100,50,10,5,2,1]while1:num=list(map(int,input().split()))ifnum[0]==0:#满足条件退出while 题解列表 2021年12月24日 0 点赞 0 评论 1047 浏览 评分:0.0
str = replace(old, new)替换所有空格 就这????就这???while1:st=input()NewSt=st.replace('','')print(NewSt) 题解列表 2021年12月24日 0 点赞 0 评论 616 浏览 评分:0.0
题解 1161: 回文数(二)(python) 摘要:def n_to_ten(n,m): j = 0 sum =0 for i in str(m)[::-1]: sum += int(i)*n**j …… 题解列表 2021年12月24日 0 点赞 0 评论 994 浏览 评分:0.0
1129: C语言训练-排序问题<2> 快速排序法 解题思路:采用快速排序法,采用最左边的数为基准数,将小于等于基准点的数全部放到基准点右边,将大于等于基准点的数全部放到基准点左边,实现从大到小的排序注意事项:相比冒泡排序,每次交换是跳跃式的,最差情况下与冒泡排序时间复杂度一致,此题下时间复杂度与冒泡排序一致参考代码:#include 题解列表 2021年12月24日 0 点赞 0 评论 787 浏览 评分:0.0