首页 软件开发 代码片段 c/c++ ( Page 7 )

c/c++ 378

#C/C++
C语言基础:通过指针遍历字符数组转换字符串为大写

#include <stdio.h> #include <ctype.h> char *string_uppercase(char *string) { c…

2015-07-03 204

#C/C++
磁盘检测C语言代码片段

#include <stdio.h> #include <dos.h> #include <malloc.h> void main(void) …

2015-07-03 298

#C/C++
C语言基础:获得当前日期和时间

#include <stdio.h> #include <time.h> int main (void) { struct tm *gm_date; tim…

2015-07-03 1,013

#C/C++
克努特 – 莫里斯 – 普拉特算法的C语言实现

克努特 – 莫里斯 – 普拉特算法的C语言实现 /* Copyright 2011 Shao-Chuan Wang <shaochuan.wang A…

2015-07-03 503

#C/C++
C语言版的算24游戏代码

给定4个1-9之间的数,通过加减乘除四则运算算出24来,可以使用括号 #include "stdafx.h" #include <stdio.h> …

2015-07-02 264

#C/C++
一种改进的求整数x的y次幂

#include <iostream> #include <cstdlib> #include <ctime> using namespace …

2015-07-02 219

#C/C++
C数据结构 – KMP算法的实现

// KMP字符串模式匹配算法 // 输入: S是主串,T是模式串,pos是S中的起始位置 // 输出: 如果匹配成功返回起始位置,否则返回-1 int KMP(PString S…

2015-07-02 712

#C/C++
C++数组反转代码

#include <stdio.h> inline void xchg(int *a,int *b) { (*a)^=(*b);//^=(*a)^=(*b); (*b)…

2015-07-02 729

#C/C++
C语言实现的文件型图书管理系统

#include<stdio.h> #include<stdlib.h> #include<string.h> struct book{ int…

2015-07-02 847

#C/C++
C语言版的Base-64加密解密函数

#include <stdint.h> #include <stdlib.h> #include <string.h> #define BLOC…

2015-07-02 266

#C/C++
C++霍夫曼编码(Huffman Coding)

霍夫曼编码(Huffman Coding)是一种编码方式,是一种用于无损数据压缩的熵编码(权编码)算法。1952年,David A. Huffman在麻省理工攻读博士时所发明的,并…

2015-07-02 373

#C/C++
C++分割文件并进行BASE64编码

#include <string> using namespace std; string Encode(char* Data,long DataByte) { //编…

2015-07-02 161
1 5 6 7 8 9 32