30 lines
588 B
C++
30 lines
588 B
C++
#include <iostream>
|
|
#include <sstream>
|
|
#include <vector>
|
|
#include "num_set.h"
|
|
|
|
using namespace std;
|
|
|
|
const string usage = "usage: test <index> <0/1>";
|
|
|
|
int main(int argc, char * argv[]) {
|
|
if (argc < 3) {
|
|
cerr << usage << endl;
|
|
return 1;
|
|
}
|
|
int index, compliment;
|
|
istringstream iss0(argv[1]);
|
|
iss0 >> index;
|
|
index = index % 5;
|
|
istringstream iss1(argv[2]);
|
|
iss1 >> compliment;
|
|
compliment = compliment % 2;
|
|
|
|
vector<string> nums = generate_numbers(index, compliment);
|
|
|
|
for(string i: nums)
|
|
cout << i << endl;
|
|
|
|
return 0;
|
|
}
|