- 博客(20)
- 资源 (1)
- 收藏
- 关注
翻译 天勤上源码
#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#define len 3;#define maxSize 100;//顺序表的结构体定义typedef struct { int data[100]; int length;}...
2019-04-18 21:43:34
603
原创 the c programming language 对文件操作cat程序
#include <stdio.h>#include "stdarg.h"//编写出将多个文件连接起来的cat程序int main(int argc, char* argv[]){ FILE *fp; void filecopy(FILE *, FILE *); if (argc == 1) filecopy(std...
2019-04-17 16:39:14
291
原创 the c proggramming language 替换文本源码
#include<stdio.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#define MAXWORD 100#define BUFSIZE 100#define HASHSIZE 101static struct nlist *hashtab[HAS...
2019-04-16 21:00:58
222
原创 the c programming language 上统计单词数目源码
#include<stdio.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#define MAXWORD 100#define BUFSIZE 100char buf[BUFSIZE]; /* buffer for ungetch */int bufp =...
2019-04-16 16:55:43
222
翻译 the c programming language 上关于日期和天数转换的一段源码
static char daytab[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};/* day_of_year: set day of year from month & day *...
2019-04-14 12:08:52
194
翻译 the c programming language 上快排代码
//使用递归实现快速排序 void qsort(int v[], int left, int right)//left,right代表左右扫描 { int i, last; void swap(int v[], int i, int j); if (left >= right) /* 数组是空的时候 */ ...
2019-04-13 15:05:27
245
翻译 王道上的快速排序算法代码
void QuickSort(int R[], int low, int high) { int i, j, temp; i = low; j = high; temp = R[low];//轴枢 while (i < j) { while (j > i && R[j...
2019-04-13 15:04:28
2509
翻译 the c programming lanuage 逆波兰源码
//逆波兰表示法#include<stdio.h>#include<stdlib.h>#include <ctype.h>int getch(void);void ungetch(int);#define MAXOP 100 /* max size of operand or operator */#define NUMBER '0' /*...
2019-04-12 16:42:07
151
原创 the c programming language 需要匹配到的字符串,若匹配到则打印该行
#include <stdio.h>#include<stdlib.h>#define MAXLINE 1000;void shellsort(int v[], int n);int getline(char line[], int max);int strindex(char source[], char searchfor[]);int binsearch(...
2019-04-11 16:07:51
161
原创 根据the c proggramming language 的希尔代码自己理解更改的代码
#include <stdio.h>#include<stdlib.h>void shellsort(int v[], int n);int binsearch(int x, int v[], int n);int main() { int v[] = { 49,38,65,97,76,13,27,49,55,04 }; shellsort(v, 1...
2019-04-10 17:51:49
139
原创 the c programming language 上的希尔排序代码
#include <stdio.h>#include<stdlib.h>void shellsort(int v[], int n);int binsearch(int x, int v[], int n);int main() { int v[] = { 49,38,65,97,76,13,27,49,55,04 }; shellsort(v...
2019-04-10 17:19:34
141
翻译 The+C+Programming+Language练习1-21原书答案
#include <stdio.h>#define TABINC 8 /* tab increment size *//* replace strings of blanks with tabs and blanks */int main(){ int c, nb, nt, pos; nb = 0; /* # of blanks necessary */ ...
2019-04-08 15:55:34
735
翻译 练习 1-20 编写程序 detab,将输入中的制表符替换成适当数目的空格,使空格充满到 下一个制表符终止位的地方。假设制表符终止位的位置是固定的,比如每隔 n 列就会出现一 个制表符终止位。n 应该
#include <stdio.h>#define TABINC 8 /* tab increment size *//* replace tabs with the proper number of blanks */int main(){ int c, nb, pos; nb = 0; /* number of blanks necessary */ ...
2019-04-08 09:59:01
507
2
原创 The+C+Programming+Language练习1-19
#include <stdio.h>#include <stdlib.h>//练习 1-19 编写函数 reverse(s),将字符串 s 中的字符顺序颠倒过来。使用该函数//编写一个程序,每次颠倒一个输入行中的字符顺序。 int getline(char s[], int max);void reverse(char s[], int len);int ma...
2019-04-07 23:34:04
282
原创 The+C+Programming+Language 练习1-17自我实现
#include <stdio.h>#define MAXLINE 1000 /* maximum input line size *///练习 1-17 编写一个程序,打印长度大于 80 个字符的所有输入行。int getline(char line[], int maxline);void copy(char to[], char from[]);/* printf l...
2019-04-07 20:56:43
200
翻译 The+C+Programming+Language 练习1-16原书答案
#include <stdio.h>#define MAXLINE 1000 /* maximum input line size */int getline(char line[], int maxline);void copy(char to[], char from[]);/* printf longest input line */int main(){ i...
2019-04-07 20:09:40
756
1
原创 the c language练习 1-16
#include <stdio.h>#include<stdlib.h>#define MAXLINE 1000 /* maximum input line length *///练习 1-16 修改打印最长文本行的程序的主程序 main,使之可以打印任意长度的输入//行的长度,并尽可能多地打印文本。int getline(char line[], int max...
2019-04-04 23:47:01
229
翻译 The+C+Programming+Language字符数组例子
//读入一串文本行,并把最长的文本行输出出来#include <stdio.h>#define MAXLINE 100;int getLine( char line[],int maxline);void copy(char to[], const char from[]);int main(){ int len;//一行的字符长度 char line[...
2019-04-02 00:19:57
160
原创 The C Programming Language习题1-12
#define IN 1;#define OUT 0;int num,state; int c; while((c=getchar()) != EOF){ if(c == ' ' || c == '\n' || c == '\t'){ state = OUT; }else if(state == 0){ ...
2019-03-31 14:14:29
241
原创 关于C语言中scanf()和getchar()的一点总结和对国内C教材的一点吐槽
最近重新学习C语言,建议大家看看篇帖子http://tieba.baidu.com/p/2843103544?traceid=建议广大学生拿到国内的计算教材的第一时间就把它rjljt......自己领会。下面是关于重新学习scanf()和getchar()的一点总结关于这点我也要吐槽一下,看了国内那么多帖子,发现不是讲的逻辑乱不全,要不然就是还有错的,而且很多不知道是不是受国内...
2019-03-31 00:02:04
347
vcxsrv-64.1.20.8.1.installer.exe
2020-04-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人