combination.cpp
来自「一个类似STL的自动机的源代码库」· C++ 代码 · 共 30 行
CPP
30 行
#include <astl.h>#include <combinatory.h>#include <stream.h>#include <tools.h>#include <cursor.h>#include <ccopy.h>#include <iostream>int main(int argc, char** argv){ config c(argc, argv, 0, "", "n p", "generate a DFA recognizing combinations"); int n = 0, p = 0; if (c.arg_pos < argc) n = atoi(argv[c.arg_pos]); else c.usage(); if (++c.arg_pos < argc) p = atoi(argv[c.arg_pos]); if (p < 1 || p > n) { cerr << argv[0] << ": p must be greater than n" << endl; c.usage(); } DFA_stream out(cout); if (c.state_mark) clone(out, dfirst_markc(combinationc(n, p))); else clone(out, dfirstc(combinationc(n, p))); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?