搜索资源列表
houzhuishi2
- \"栈顶运算符为: %c\\n\",getTop(optr)) printf(\"此时运算符为:%c\\n\",e) printf(\"栈顶运算符优先级低,%c进栈\\n\",e) push(optr,e) //e进运算符栈
c
- c++冒泡排序#include \"stdio.h\" void sort() { int i,count=0,a[20] int k=20 printf(\"please input 20 defferent numbers?\\n\") for(i=0 i<20 i++) scanf(\" %d\\a\",&a[i]) while(count<20) { for(i=0 i<k i++)
白噪声随机数的产生
- #include<stdio.h> #include<stdlib.h> #include<math.h> #define E 6 #define D 1 double N() { double n=0;int i; for(i=0;i<12;i++) n+=(double)rand()/RAND_MAX; n=(n-E)/sqrt(D); return n; } void main() {
tony
- 成績顯示三個部份abc #include<stdio.h> #include<stdlib.h> int main(void) { float gread printf("請輸入分數\n") scanf("%f",&gread) if(gread>=80&&gread<=100) printf("成績為A\n") else if(gread>=60&&gread<=79) {
qishi
- void Knight(int i , int j) { // printf("%d %dn",i,j) if (board[i][j] != 0 || i < 0 || i >= Size || j < 0 || j >= Size ) { return } step++ board[i][j]=step if (step == Size*Size) { showboard() system("PAUSE
puke
- 编号为1-52张牌,正面向上,从第2张开始,以2为基数,是2的倍数的牌翻一次,直到最后一张牌;然后,从第3张开始,以3为基数,是3的倍数的牌翻一次,直到最后一张牌;然后…从第4张开始,以4为基数,是4的倍数的牌翻一次, 直到最后一张牌;...再依次5的倍数的牌翻一次,6的,7的 直到 以52为基数的 翻过,输出:这时正面向上的牌有哪些?-#include "stdio.h" void main() {/*采用数组存储,循环嵌套实现*/ int i,j in
student_score
- 学生成绩管理,实现按姓名、学号查询,以及增加、删除、修改学生成绩,显示不同分数段的学生成绩和按总成绩排序结果并输出成绩等功能。 printf("| 10 按学号排序结果并输出成绩-Student performance management, to achieve, by name, student number query, as well as add, delete, modify student achievement, indicating a different segment
Data_struct_1
- 数据结构课后设计题第一章 ◆1.16② 试写一算法,如果三个整数X,Y和Z 的值不是依次非递增的,则通过交换,令其为 非递增。 要求实现下列函数: void Descend(int &x, int &y, int &z) void Descend(int &x, int &y, int &z) { int temp if(x<=y){temp=x x=y y=temp } if(y<=z){temp=y y=z z
Huffmantree
- 赫夫曼树: 按先序输入二叉树 数的结点是: 输入赫夫曼树的mm个权值: HuffmanCoding(HT,HC,&HT[mm].weight,mm) printf(HC,mm) -Huffman tree: sequence input by the first node is a binary number: Enter a Huffman tree mm Weight: HuffmanCoding (HT, HC, & HT [mm]. Weight, mm)
NO2
- 顺序表 create_sqlist(Sqlist *L)/*创建顺序表*/ { int k ElemType x k=0 scanf(" d",&x) while(x!=0) { L->data[k]=x k++ scanf(" d",&x) } L->length=k } void print_sqlist(Sqlist *L)/*输出顺序表*/ { int j
include
- 在采用二叉链表存储的二叉树上,编程实现从根结点到指定结点之间的路径.-#include <stdio.h> #include <stdlib.h> typedef struct BTnode { char data struct BTnode*lchild,*rchild }BTNode #define NodeLen sizeof(BTNode) BTNODE*Creat_Bt(void) void Preorder
paixu
- 用指向指针的方法对n个数进行排序并输出,n和各整数在主函数中输入-#include <stdio.h> #define SIZE 100//数组最大长度 #define SWAP(x, y, t) (t = x, x = y, y = t)//交换两个数 void sort(int**p, int n){//排序函数 int i, j int min int temp for(i = 0 i < n- 1 i++){
WinRAR-ZIP
- 在C++用递归实现链表逆序 使得倒序输出。-#include <stdio.h> #include <stdlib.h> #include <time.h> const int M=10 typedef int Type typedef struct Node{ Type data struct Node* next }Node void add_elem(Node**head,Type data){ Node
1111
- 二叉树的建立演示,可以将你输入的数字建立完全的二叉树-#include <stdio.h> #include <string.h> #include <windows.h> struct BTree { int data struct BTree* left struct BTree* right } //end struct BTree BTree* CreateLeaf(int number) {
用链表求循环小数
- 对于任意的真分数 N/M ( 0 < N < M ),均可以求出对应的小数。如果采用链表表示各个小数,对于循环节采用循环链表表示,则所有分数均可以表示为如下链表形式。 输入: N M 输出: 转换后的小数(不超过 50 位) 要求: 仅编写将分数转换为小数的函数 change( int n, int m, NODE * head ) 。 预设代码: /* PRESET CODE BEGIN - NEVER TOUCH CODE BELOW */ #in
dsxt-1
- 数据结构第一章试写一个算法,自大到小依次输出顺序读入的三个数X、Y和Z的值(data stru for (i=2; ((n%i)!=0)&&(i<sqrt(n)); i++); if i>sqrt(n) printf("%d is a prime number", n) else printf("%d is not a prime number", n); }/)
哈夫曼编码与字母频率统计
- 统计词频并构建哈夫曼树,左边为0,右边为1。(HuffmanTree ,calculate every the number of every zee and using '1' and '0' create a tree and printf the string.)