
C
饮闲
写作是门孤独的手艺,意义却在于分享
展开
-
可以实现分组的简单小程序
嗯,名单是我们班同学的名单,我注释掉了,你们自己添加,有C++基础应该不难的。#include <iostream>#include <ctime>#include <cstdlib>#include <string>#include <algorithm>using namespace std;const int N = 20000;string b[]={"\0",// 分组名单,如"张三","lisi",等等};原创 2020-09-02 15:03:43 · 4046 阅读 · 0 评论 -
邻接矩阵的简易实现 C语言
主函数#include <stdio.h>#include <stdlib.h>#include "AdjMatrix.h"//!int main(){ /* if (freopen("D:\\y.txt","r",stdin)==NULL) printf("打开文件失败!\n"); */ if(freopen("data.txt","r",stdin)==NULL) { printf("File open原创 2020-09-02 14:58:48 · 609 阅读 · 0 评论 -
定长顺序栈 C语言
主函数#include <stdio.h>#include <stdlib.h>#include "SString.h"int main(){ SString s1,s2; InitSString(&s1); InitSString(&s2); printf("s1: %s len:%d\n",s1.ch,s1.len); printf("s2: %s len:%d\n",s2.ch,s2.len);原创 2020-09-01 19:40:37 · 334 阅读 · 0 评论 -
顺序栈 C语言练习
#include <stdio.h>#define bool char#define true 1#define false 0#define stack_size 100typedef char StackElemType;typedef struct{ StackElemType elem[stack_size]; int top;}SeqStack;void InitStack(SeqStack *S){ S->top=-1;原创 2020-09-01 19:37:55 · 337 阅读 · 0 评论 -
链式栈 C语言练习
#include <stdio.h>#include <stdlib.h>#define true 1#define false 0#define bool chartypedef char ElemType;typedef struct node1{ ElemType data; struct node1 *next;}LinkStackNode1,*LinkStack1;//typedef LinkStackNode1 *LinkStac原创 2020-09-01 19:37:02 · 309 阅读 · 0 评论