先看两个例子,比较不同: 例一(有回调函数) #include <iostream> using namespace std; void foo_one() { cout<<"foo_one"<<endl; } void foo_two() { cout<<"foo_two"<<endl; } ty ...
分类:
其他好文 时间:
2020-11-11 16:29:50
阅读次数:
8
###P2915 [USACO08NOV]Mixed Up Cows G dfs去做 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #define ll long long using namespace ...
分类:
其他好文 时间:
2020-11-11 15:59:42
阅读次数:
7
1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 const int N=1010; 6 7 int dp[N][N]; 8 int w[N],v[N]; 9 int n,m; 10 11 int main() ...
分类:
其他好文 时间:
2020-11-10 10:43:32
阅读次数:
7
16. Command(命令) 16.1 定义 将一个请求封装成一个对象,从而让你使用不同的请求把客户端参数化,对请求排队或者记录请求日志,可以提供命令的撤销和恢复功能。 16.2.优点 ■ 类间解耦。调用者角色与接收者角色之间没有任何依赖关系,调用者实现功能时只需要调用Command中的execu ...
分类:
其他好文 时间:
2020-11-08 17:58:51
阅读次数:
46
#include<iostream> #include<cstring> #include<cmath> using namespace std; char map[8][8]; int n, m, t; int dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}}; bool ...
分类:
其他好文 时间:
2020-11-08 17:14:10
阅读次数:
17
#include<iostream> #include<memory.h> #include<cmath> #include<algorithm> using namespace std; typedef struct { int x, y; }node; node d[6000]; int r, ...
分类:
其他好文 时间:
2020-11-08 17:11:46
阅读次数:
15
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #define MAXN 100000 using namespace std; int pri[MAXN];///质数数列 bool vis[MAXN ...
分类:
其他好文 时间:
2020-11-08 17:07:41
阅读次数:
13
#include #include <string.h> #define size 10 using namespace std; //含有一个二元算数式的三个值 typedef struct{ float x = 0,y = 0; //x,y为给定的随机数 float r = 0; //r为算数式 ...
分类:
其他好文 时间:
2020-11-08 17:05:55
阅读次数:
19
8.1 PAT dfs+dijkstra 重做 // PAT 1018 #include<stdio.h> #include<vector> #include<map> #include<algorithm> using namespace std; const int N = 600; const ...
分类:
其他好文 时间:
2020-11-07 16:44:48
阅读次数:
17
#include<iostream> #include<cstdio> #include<set> #define MAXSIZE 51 using namespace std; set<int> s[MAXSIZE];/*建立set数组,自动除去重复的并且升序排好,然后利用count函数即可,知识 ...
分类:
其他好文 时间:
2020-11-07 16:42:41
阅读次数:
18