adding cs142 code
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user