20 lines
456 B
C++
20 lines
456 B
C++
#include <iostream>
|
|
#include <cstdlib>
|
|
#include "Spigot.hpp"
|
|
|
|
int main(int argc, char **argv) {
|
|
int numDigits = 0;
|
|
if(argc < 2) {
|
|
std::cout << "Usage: spigot <numDigits>" << std::endl;
|
|
return -1;
|
|
} else {
|
|
numDigits = std::atoi((const char *)argv[1]);
|
|
}
|
|
Spigot *piSpigot = new Spigot(numDigits);
|
|
for(int i = 0; i < numDigits; i++) {
|
|
piSpigot->pump();
|
|
}
|
|
std::cout << std::endl;
|
|
return 0;
|
|
}
|