Advertisement
Guest User

functions.cpp

a guest
Sep 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include "functions.h"
  4.  
  5. void readForceValuesFromStdIn(double* leftTeam, double* rightTeam, unsigned const int noParticipants) {
  6. double inpt = 0;
  7. int left{0}, right{0};
  8. for (int i = 0; i < noParticipants; i++) {
  9. std::cin >> inpt;
  10. if (i%2) {
  11. leftTeam[left] = inpt;
  12. leftTeam++;
  13. } else if (!(i%2)) {
  14. rightTeam[right] = inpt;
  15. rightTeam++;
  16. }
  17. }
  18. }
  19.  
  20. bool validForces(double* forces, int noParticipants) {
  21. for (int i = 0; i < noParticipants; i++) {
  22. if (forces[i] < 0) {
  23. return false;
  24. }
  25. }
  26. return true;
  27. }
  28.  
  29. double calculateForce(const double* leftTeam, const double* rightTeam, unsigned const int noParticipants) {
  30.  
  31. }
  32.  
  33. void printWinnerToStdOut(const char* leftTeamName, const char* rightTeamName, const double netForce) {
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement