olexander_dan

Untitled

Apr 30th, 2019
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. void makeTrail(std::ofstream& ofs, const int64_t& amountOfVertices) {
  2.     size_t v = 0;
  3.     while ((v + 1) < amountOfVertices)
  4.         ofs << v << ' ' << ++v << std::endl;
  5. }
  6. void makeTour(std::ofstream& ofs, const int64_t& amountOfVertices) {
  7.     size_t v = 0;
  8.     while (true) {
  9.         ofs << v << ' ';
  10.         if ((v + 1) != amountOfVertices)
  11.             ofs << ++v << std::endl;
  12.         else {
  13.             ofs << '0' << std::endl;
  14.             break;
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment