SWUST OJ
ZeeE_6
这个作者很懒,什么都没留下…
展开
-
SWUST OJ 38: 最大公约数和最小公倍数
【代码】SWUST OJ 38: 最大公约数和最小公倍数。原创 2023-05-20 11:26:02 · 216 阅读 · 0 评论 -
SWUST OJ 641: The Dutch flag problem
【代码】SWUST OJ 641: The Dutch flag problem。原创 2023-05-20 11:00:55 · 179 阅读 · 0 评论 -
SWUST OJ 642: 俄式乘法
【代码】SWUST OJ 642: 俄式乘法。原创 2023-05-20 10:43:21 · 153 阅读 · 0 评论 -
SWUST OJ 640: Binary search
【代码】SWUST OJ 640: Binary search。原创 2023-05-20 00:17:10 · 160 阅读 · 0 评论 -
SWUST OJ 76: 数字模式的识别
【代码】SWUST OJ 76: 数字模式的识别。原创 2023-05-19 23:48:40 · 216 阅读 · 0 评论 -
SWUST OJ 539: Horner scheme
【代码】SWUST OJ 539: Horner scheme。原创 2023-05-19 23:16:14 · 78 阅读 · 0 评论 -
SWUST OJ 425: Polynomial calculate
【代码】SWUST OJ 425: Polynomial calculate。原创 2023-05-19 23:14:16 · 67 阅读 · 0 评论 -
SWUST OJ 446: 合并排序
【代码】SWUST OJ 446: 合并排序。原创 2023-05-19 15:47:52 · 156 阅读 · 0 评论 -
SWUST OJ 413: Quick Sort
【代码】SWUST OJ 413: Quick Sort。原创 2023-05-19 15:45:41 · 201 阅读 · 0 评论 -
SWUST OJ 342: 变位词
【代码】SWUST OJ 342: 变位词。原创 2023-05-19 15:45:16 · 253 阅读 · 0 评论 -
SWUST OJ 536: The Josephus Problem
【代码】SWUST OJ 536: The Josephus Problem。原创 2023-05-19 15:41:13 · 92 阅读 · 0 评论 -
SWUST OJ 480: Locker doors
【代码】SWUST OJ 480: Locker doors。原创 2023-05-19 15:38:26 · 57 阅读 · 0 评论 -
SWUST OJ 254: 翻煎饼
【代码】SWUST OJ 254: 翻煎饼。原创 2023-05-19 15:35:13 · 365 阅读 · 0 评论 -
SWUST OJ 979: 输出利用先序遍历创建的二叉树的后序遍历序列
#include <stdio.h>#include <stdlib.h>typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { pT = (TNode*...原创 2022-04-24 00:07:40 · 969 阅读 · 0 评论 -
SWUST OJ 978: 输出利用先序遍历创建的二叉树的中序遍历序列
#include <stdio.h>#include <stdlib.h>typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { pT = (TNode*...原创 2022-04-24 00:06:43 · 995 阅读 · 0 评论 -
SWUST OJ 977: 统计利用先序遍历创建的二叉树中的空链域个数
#include <stdio.h>#include <stdlib.h>int n = 0;typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { ...原创 2022-04-24 00:06:04 · 647 阅读 · 0 评论 -
SWUST OJ 976: 统计利用先序遍历创建的二叉树的度为1的结点个数
#include <stdio.h>#include <stdlib.h>int n = 0;typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { ...原创 2022-04-24 00:05:19 · 488 阅读 · 0 评论 -
SWUST OJ 975: 统计利用先序遍历创建的二叉树的度为2的结点个数
#include <stdio.h>#include <stdlib.h>int n = 0;typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { ...原创 2022-04-24 00:04:31 · 820 阅读 · 0 评论 -
SWUST OJ 973: 统计利用先序遍历创建的二叉树叶结点的个数
#include <stdio.h>#include <stdlib.h>int n = 0;typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { ...原创 2022-04-24 00:03:44 · 330 阅读 · 0 评论 -
SWUST OJ 972: 统计利用先序遍历创建的二叉树的宽度
#include <stdio.h>#include <stdlib.h>#define MAXSIZE 100int a[MAXSIZE];typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#')...原创 2022-04-24 00:02:59 · 937 阅读 · 0 评论 -
SWUST OJ 971: 统计利用先序遍历创建的二叉树的深度
#include <stdio.h>#include <stdlib.h>typedef struct TNode{ char data; struct TNode* lchild; struct TNode* rchild;}TNode;TNode* creat(){ char x; TNode* pT; scanf("%c", &x); if (x == '#') pT = NULL; else { pT = (TNode*...原创 2022-04-24 00:02:08 · 1032 阅读 · 0 评论 -
SWUST OJ 963: 小偷的背包
#include <stdio.h>#define MAXSIZE 100int bag(int s, int n, int a[MAXSIZE]){ if (s == 0) return 1; if (s != 0 && n <= 0) return 0; if (bag(s - a[n - 1], n - 1, a) == 1) return 1; bag(s, n - 1, a);}int main(){ int s, n,...原创 2022-04-23 23:32:00 · 126 阅读 · 0 评论 -
SWUST OJ 1027: 舞伴问题
#include <stdio.h>#include <stdlib.h>typedef struct QNode{ char data; struct QNode* next;}QNode;void enQ(QNode* pQ, int e){ QNode* pR, * pT; pR = pQ; while (pR->next != NULL) pR = pR->next; pT = (QNode*)malloc(sizeof(QN...原创 2022-04-23 23:31:02 · 367 阅读 · 0 评论 -
SWUST OJ 966: 打印杨辉三角形
#include <stdio.h>#include <stdlib.h>typedef struct QNode{ int data; struct QNode* next;}QNode;void push(QNode* pQ, int x){ QNode* pR, * pS; pR = pQ; while (pR->next != NULL) pR = pR->next; pS = (QNode*)malloc(sizeof...原创 2022-04-23 23:30:17 · 187 阅读 · 0 评论 -
SWUST OJ 1046: 链栈基本操作的实现
#include <stdio.h>#include <stdlib.h>typedef struct SNode{ int data; struct SNode* next;}SNode;void push(SNode* pS, int num){ SNode* pR; pR = (SNode*)malloc(sizeof(SNode)); pR->data = num; pR->next = pS->next; pS->...原创 2022-04-23 23:28:09 · 479 阅读 · 0 评论 -
SWUST OJ 1044: 顺序栈基本操作的实现
#include <stdio.h>#include <stdlib.h>#define MAXSIZE 100typedef struct{ int data[MAXSIZE]; int top;}SqStack;void push(SqStack* pS){ int n, x, i = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &x); pS...原创 2022-04-23 23:27:11 · 403 阅读 · 0 评论 -
SWUST OJ 1043: 利用栈完成后缀表达式的计算
#include <stdio.h>#include <stdlib.h>typedef struct SNode{ int data; struct SNode* next;}SNode;int push(SNode* pS, int x){ SNode* pR; pR = (SNode*)malloc(sizeof(SNode)); pR->data = x; pR->next = pS->next; pS->next = .原创 2022-04-23 23:26:15 · 110 阅读 · 0 评论 -
SWUST OJ 1042: 中缀表达式转换为后缀表达式
#include <stdio.h>#include <stdlib.h>typedef struct SNode{ char data; struct SNode* next;}SNode;void pushs(SNode* pS, char e){ SNode* pR, *pQ; pQ = pS; while (pQ->next != NULL) pQ = pQ->next; pR = (SNode*)malloc(sizeof(...原创 2022-04-23 23:24:55 · 293 阅读 · 0 评论 -
SWUST OJ 1028: 特定字符序列的判断
#include <stdio.h>#include <stdlib.h>typedef struct SNode{ char data; struct SNode* next;}SNode;void push(SNode* pS, char x){ SNode* pR; pR = (SNode*)malloc(sizeof(SNode)); pR->data = x; pR->next = pS->next; pS->ne...原创 2022-04-23 23:23:06 · 282 阅读 · 0 评论 -
SWUST OJ 962: 括号匹配问题
#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAXSIZE 100typedef struct SNode{ char data; struct SNode* next;}SNode;int push(SNode* pS, char a){ SNode* pR; pR = (SNode*)malloc(sizeof(SNode)); pR->dat...原创 2022-04-23 23:22:01 · 758 阅读 · 0 评论 -
SWUST OJ 961: 进制转换问题
#include <stdio.h>#include <stdlib.h>typedef struct SNode{ int data; struct SNode* next;}SNode;void push(SNode* pS, int t){ SNode* pR; pR = (SNode*)malloc(sizeof(SNode)); pR->data = t; pR->next = pS->next; pS->next...原创 2022-04-23 23:21:12 · 366 阅读 · 0 评论 -
SWUST OJ 1040 一元多项式加法运算的实现
#include <stdio.h>#include <stdlib.h>typedef struct LNode{ int data; int index; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int m, n; LNode* pR, * pS; pR = pL; while (1) { scanf("%d,%d", &m, &n); if (m...原创 2022-04-19 17:16:05 · 321 阅读 · 0 评论 -
SWUST OJ 1039 单链表中信息的分类
#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAXSIZE 100 typedef struct LNode{ char data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int n, i = 0; char a[MAXSIZE]; LNode* pR, * pS; pR = p...原创 2022-04-19 17:15:24 · 870 阅读 · 0 评论 -
SWUST OJ 960 双向链表的操作问题
#include <stdio.h>#include <stdlib.h>typedef struct LNode{ int data; struct LNode* prior; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int n, i = 0; LNode* pR, * pS; pR = pL; scanf("%d", &n); for (i = 0; i <...原创 2022-04-19 17:14:41 · 500 阅读 · 1 评论 -
SWUST OJ 957 逆置单链表
#include <stdio.h>#include <stdlib.h>int n;typedef struct LNode{ char data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int i = 0; LNode* pR, * pS; scanf("%d", &n); getchar(); pR = pL; for (i = 0; i < n; ...原创 2022-04-19 17:14:00 · 776 阅读 · 1 评论 -
SWUST OJ 956 约瑟夫问题的实现
#include <stdio.h>#include <stdlib.h>typedef struct LNode{ int data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int n, i = 2; LNode* pR, * pS; scanf("%d", &n); pL->data = 1; pR = pL; for (i = 2; i <= n;...原创 2022-04-19 17:12:47 · 457 阅读 · 0 评论 -
SWUST OJ 955 单链表上查找算法的实现
#include <stdio.h>#include <stdlib.h>int n;typedef struct LNode{ int data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int i = 0; LNode* pR, * pS; scanf("%d", &n); pR = pL; for (i = 0; i < n; i++) { pS ...原创 2022-04-19 17:11:50 · 196 阅读 · 0 评论 -
SWUST OJ 954 单链表的链接
#include <stdio.h>#include <stdlib.h>typedef struct LNode{ char data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int n, i = 0; LNode* pR, * pS; scanf("%d", &n); getchar(); pR = pL; for (i = 0; i < n; i++)...原创 2022-04-19 17:10:41 · 465 阅读 · 0 评论 -
SWUST OJ 953 单链表的删除操作的实现
#include <stdio.h>#include <stdlib.h>int n;typedef struct LNode{ int data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int i = 0; LNode* pR, * pS; scanf("%d", &n); pR = pL; for (i = 0; i < n; i++) { pS ...原创 2022-04-19 17:08:28 · 1355 阅读 · 0 评论 -
SWUST OJ 952 单链表的插入操作的实现
#include <stdio.h>#include <stdlib.h>int n;typedef struct LNode{ int data; struct LNode* next;}LNode;void initLinkList(LNode* pL){ int i = 0; LNode* pR, * pS; scanf("%d", &n); pR = pL; for (i = 0; i < n; i++) { pS ...原创 2022-04-19 17:07:33 · 1392 阅读 · 0 评论