C++
BoBoAn_DouYa
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
多线程相关
多线程相关原创 2022-08-11 19:16:22 · 724 阅读 · 1 评论 -
strcmp与stricmp与==之间的关系
原型:extern int strcmp(const void *s1, const void *s2);用法:#include 功能:比较字符串s1和s2是否相同,区分大小写。说明:如果s1=s2则返回零,否则返回非零值。原型:extern int stricmp(char *s1,char * s2); 用法:#in原创 2013-09-07 00:58:50 · 1555 阅读 · 0 评论 -
gets puts getchar putchar的区别
#include #include #includeusing namespace std;int main(){ char str[20]; gets(str); puts(str); puts(str+4); printf("%s",str); // return 0; char ch; ch=getch原创 2013-09-07 10:22:58 · 1843 阅读 · 0 评论 -
高精度乘法
#include#includeusing namespace std;char str1[1000];char str2[1000];int a[1000];int b[1000];int i,j,k,len1,len2;bool sign;void mul(int *a, int *b){ int c[2000]={0},i,j,carry=0; for ( i =原创 2013-09-07 11:23:30 · 1113 阅读 · 0 评论 -
长整型 long long
改成 max=9223372036854775807LL; 这样就不会有警告了。这样这个数据在未赋值前就被认为是long long型的 (后面跟有LL)#includeusing namespace std;int main(){ unsigned long long i = 0; printf("long long type is %d bytes\n",si原创 2013-09-08 20:35:36 · 3815 阅读 · 0 评论 -
poj 3461 Oulipo
OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17887 Accepted: 7194DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La原创 2013-09-10 18:15:11 · 821 阅读 · 0 评论 -
fight club
Time Limit: 1sec Memory Limit:32MBDescriptionFight club is an organization where you release your pressure and emotion by fighting the other club members. The fight begins like this: n pe原创 2013-09-10 23:05:38 · 1322 阅读 · 0 评论 -
KMP
#include #include #include #include using namespace std;int next[1000];void getnext(char *b,int lenb){ int k=-1,j=0; next[0]=-1; while(j<lenb-1) { if(b[k]==b[j]||k==-1) {原创 2013-09-10 17:53:55 · 1158 阅读 · 0 评论 -
SOJ 1090 highways prim算法
DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this probl原创 2013-09-14 20:54:58 · 1490 阅读 · 0 评论 -
BST二叉查找树
源代码如下所示:#includeusing namespace std;class BSTree{public: int data; BSTree *left; BSTree *right; BSTree(int data,BSTree *left = NULL ,BSTree * right= NULL) { this->data= data;原创 2013-09-20 18:26:05 · 1151 阅读 · 0 评论 -
C++内存管理
#ifndef _EXCELSIOR_CACHEMANAGE_H_#define _EXCELSIOR_CACHEMANAGE_H_#include using namespace std;#include "List.h"struct TCacheAllocStauts { UINT8** pType; UINT32 start; UINT32 size;原创 2013-09-20 18:28:52 · 839 阅读 · 0 评论 -
map的用法
#include#includeusing namespace std;struct comp{ /* data */ typedef std::pair value_type; bool operator()(const value_type &ls,const value_type &rs) { return (ls.first<rs.first)||(ls.first==原创 2013-09-20 18:30:44 · 957 阅读 · 0 评论 -
floyd算法实现
#include#include#includeusing namespace std;const int Max=100;const int INF=5000;class Graph{public: /* data */ int VertexNum;//一个图的点数 int Edgeweight[Max][Max];//每条边的权值 bool type;//有向原创 2013-09-20 18:32:25 · 880 阅读 · 0 评论 -
一些源代码
#include#include#include#include using namespace std;int main(){ int n; cin>>n; vector v(n,8); for (int i = 0; i < 8; ++i) { /* code */ v.push_back(i); } copy(v.begi原创 2013-09-20 18:24:41 · 1090 阅读 · 0 评论 -
BF匹配算法
#includeusing namespace std;int BFmatch(string a,string b){ //vectora; int aleng=a.length(); int bleng=b.length(); for(int i=0;i<=aleng-bleng;i++) { int j=0; while(a[i]==b[j]&&j<bleng)原创 2013-09-20 18:26:57 · 1457 阅读 · 0 评论
分享