高级程序设计
lost_for_ever
这个作者很懒,什么都没留下…
展开
-
韩信点兵(scau)
#include <iostream> #include <algorithm> typedef long long ll; using namespace std; ll exgcd(ll a,ll b,ll &x,ll &y)//拓展欧几里得(辗转相除法,用于求最大公约数) { if(b==0) { x=1; y=0; return a; } ll t=exgcd(b,a%...原创 2021-11-19 16:16:05 · 580 阅读 · 0 评论 -
【无标题】链表倒叙
思路(需要修改代码):以A-B-C-D四个结点为例: 分析: 1). 若链表为空或只有一个元素,则直接返回; 2). 设置两个前后相邻的指针p,q. 将p所指向的节点作为q指向节点的后继; 3). 重复2),直到q为空 4). 调整链表头和链表尾 #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include "stdio.h" #include "malloc.h" #define LEN siz...原创 2021-11-16 21:49:53 · 275 阅读 · 0 评论