随笔分类 - C语言
C语言的刷题模块
摘要:本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印 ***** *** * *** ***** 所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。 给定任意N个符号,
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include "test_顺序表声明.h" /* run this program using the console pauser or add your own getch, system("pause") or
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> typedef struct { float coef; int expn; struct Polynomial* next; }Polynomial; //建立多项式 Polynomial *CreatePoly() { P
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #define MAXSIZE 20 //循环队列 typedef int datatype; typedef struct { datatype data[MAXSIZE];//队列的数据存储区 int front,rear
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #define MAXSIZE 20 //链栈 typedef int Elemtype; typedef struct Stacknode { Elemtype data; struct Stacknode *next; i
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #define MAXSIZE 20 typedef int datetype; typedef struct { datetype date[MAXSIZE]; int top; }SeqStack; SeqStack *s
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #define MAXSIZE 20 typedef int ElemType; typedef struct { ElemType elem[MAXSIZE]; int length; }SeqList;//定义一个顺序表
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> typedef int ElemType; typedef struct node { ElemType date;//数据域 struct node *next;//指针域 }LNode,*LinkList; //用尾插法建
阅读全文
摘要:#include<stdio.h> #define MAXSIZE 100 typedef int KeyType; typedef struct { KeyType key; }RecordType; typedef struct { RecordType r[MAXSIZE+1]; int le
阅读全文
摘要:#include<stdio.h> #define MAXSIZE 100 typedef int KeyType; typedef struct { KeyType key; }RecordType; typedef struct { RecordType r[MAXSIZE+1]; int le
阅读全文
摘要://递归排序 #include<stdio.h> #include<stdlib.h> //归并排序-合并 void merge(int arr[],int tempArr[],int left,int mid,int right) { //标记左边未排序的元素 int l_pos=left; //
阅读全文