上一页 1 ··· 9 10 11 12 13
摘要: 方法1:穷举 #include<iostream> using namespace std; int main(){ int m = 123,i;//求11mod123的逆元 for (i = 2; (11*i-1)%123!=0; i++); cout << i; system("pause"); 阅读全文
posted @ 2021-10-31 00:49 Grit_L。 阅读(65) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int GCD(int &a, int &b) { int remainder; if (b != 0) while (true) { remainder = a % b; if (remainder == 0) ret 阅读全文
posted @ 2021-10-29 03:03 Grit_L。 阅读(36) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int GCD(int x, int y) { return y == 0 ? x : GCD(y, x % y); } int main() { int x, y; x=GCD(169, 121); cout << " 阅读全文
posted @ 2021-10-29 02:59 Grit_L。 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 定义节点头文件 #ifndef _DBLNODE_H_ #define _DBLNODE_H_ template<class ElemType> struct Node{ ElemType data; Node<ElemType>* back; Node<ElemType>* next; Node( 阅读全文
posted @ 2021-10-24 21:23 Grit_L。 阅读(71) 评论(0) 推荐(0) 编辑
摘要: template<class ElemType> void Reverse(SimpleLinkList<ElemType>& la) { ElemType hElem, tElem; for (int pos = 1; pos <= la.Length()/2; pos++) { la.GetEl 阅读全文
posted @ 2021-10-23 21:00 Grit_L。 阅读(67) 评论(0) 推荐(0) 编辑
摘要: template<class ElemType> void MergeList(const SimpleLinkList <ElemType>& la, const SimpleLinkList<ElemType>& lb,SimpleLinkList <ElemType>& lc) { ElemT 阅读全文
posted @ 2021-10-23 20:56 Grit_L。 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 定义头节点 #ifndef _NODE_H_ #define _NODE_H_ //构造函数模板 template<class ElemType> struct Node { ElemType data; Node<ElemType>* next; Node();//无参的函数构造模板 Node(c 阅读全文
posted @ 2021-10-23 20:51 Grit_L。 阅读(195) 评论(0) 推荐(0) 编辑
摘要: //头文件sq_list.h #define _SQ_LIST_H_ #ifndef DEFAULT_SIZE #define DEFAULT_SIZE 1000//缺省元数个数 //顺序表模板 template <class ElemType> class SqList { protected:/ 阅读全文
posted @ 2021-10-23 20:42 Grit_L。 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13