adding cs142 code
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "util.h"
|
||||
|
||||
const string usage = "usage: app <number of people> <step>";
|
||||
|
||||
int main(int argc, char * argv []) {
|
||||
if(argc != 3) {
|
||||
cerr << usage << endl;
|
||||
return 1;
|
||||
}
|
||||
int number_of_people = atoi(argv[1]);
|
||||
int step = atoi(argv[2]);
|
||||
vector<bool> people(number_of_people, true);
|
||||
vector<int> loosers = _play_game(people, step);
|
||||
cout << loosers[loosers.size()-1] << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user