1020-猴子吃桃的问题 数据结构:数组 语言:C++ 摘要:解题思路:注意事项:参考代码:/*a[]数组存储每一天桃子的剩余量。a[i]表示第i天桃子的剩余量。 a[i]=a[i-1]-(a[i-1]/2+1) => a[i-1]=2(a[i]+1)*/#in…… 题解列表 2022年10月04日 0 点赞 0 评论 312 浏览 评分:0.0
报数问题的C++解法--暴力 摘要:解题思路:首先,输入该循环链表,在头结点指向为空时,即链表为空时,新增节点的指向就是其本身。以后新增节点以后,指针域保存的是第一个结点的地址。其次,进行排除。设置两个指针,分别为prev和p。p是pr…… 题解列表 2022年10月04日 0 点赞 0 评论 563 浏览 评分:9.5
链表合并之我用了stl容器偷懒解法 摘要:#include#include#include#include#includeusing namespace std; int main() { list<pair int n, m; …… 题解列表 2022年10月02日 0 点赞 0 评论 436 浏览 评分:9.9
结构体之成绩统计2 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;struct student{ string Id; stri…… 题解列表 2022年10月02日 0 点赞 0 评论 262 浏览 评分:0.0
运用c++中sort函数排序 摘要:解题思路:将n个数进行排序,只需将n个数放入数组内·,运用c++中sort(begin,end)函数进行排序,然后输出即可注意事项:sort(begin,end)函数中begin是数组首地址,end是…… 题解列表 2022年10月01日 0 点赞 0 评论 422 浏览 评分:0.0
第一个HelloWorld程序 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ cout<<"**************************"<…… 题解列表 2022年10月01日 0 点赞 0 评论 338 浏览 评分:0.0
简单的a+b 十分简单 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b){ cout<<a…… 题解列表 2022年09月30日 0 点赞 0 评论 541 浏览 评分:9.9
你的第一个C语言程序 摘要:解题思路:其实很简单,只要你掌握了最简单的输入输出代码就行注意事项:参考代码:#include<iostream> using namespace std; …… 题解列表 2022年09月30日 0 点赞 0 评论 742 浏览 评分:6.0
比较完善的算法 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;bool ifhuiwen(int s[],int n){ //s从下标1开始,n表示长度 …… 题解列表 2022年09月27日 0 点赞 0 评论 352 浏览 评分:0.0
1031: [编程入门]自定义函数之字符串反转(多种方法合集) 摘要:解题思路:第一个方法,也是最简单的方法,输入以后逆序输出:这里使用了strlen函数,要记得加上头文件cstring(c语言是string.h)#include <iostream> #includ…… 题解列表 2022年09月27日 0 点赞 0 评论 562 浏览 评分:9.9