📄 usepermuter.cpp
字号:
#include <iostream>
#include <string>
using namespace std;
#include "tvector.h"
#include "permuter.h"
int main()
{
tvector<int> list;
tvector<string> slist;
string names[] = {"first", "second", "third"};
int k;
for(k=0; k < 3; k++)
{ list.push_back(k);
slist.push_back(names[k]);
}
Permuter p(list);
for(p.Init(); p.HasMore(); p.Next())
{ p.Current(list);
for(k=0; k < list.size(); k++)
{ cout << list[k] << " ";
}
cout << endl;
}
for(p.Init(); p.HasMore(); p.Next())
{ p.Current(list);
for(k=0; k < list.size(); k++)
{ cout << slist[list[k]] << " ";
}
cout << endl;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -