Beispiel #1
0
int main(){

    string line;
    getline(cin, line);
    istringstream tmp(line);
    vector<int> x;
    int t;
    while (tmp >> t){
        x.push_back(t);
    }
    YahtzeeScore r;
    cout << r.maxPoints(x) << endl;


//    copy(r.begin(), r.end(), ostream_iterator<int>(cout, " "));
    return 0;
}
Beispiel #2
0
bool do_test(vector<int> toss, int __expected) {
  time_t startClock = clock();
  YahtzeeScore* instance = new YahtzeeScore();
  int __result = instance->maxPoints(toss);
  double elapsed = (double)(clock() - startClock) / CLOCKS_PER_SEC;
  delete instance;

  if (__result == __expected) {
    cout << "PASSED!" << " (" << elapsed << " seconds)" << endl;
    return true;
  } else {
    cout << "FAILED!" << " (" << elapsed << " seconds)" << endl;
    cout << "           Expected: " << to_string(__expected) << endl;
    cout << "           Received: " << to_string(__result) << endl;
    return false;
  }
}