olexander_dan

Untitled

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