Skip to content

Instantly share code, notes, and snippets.

View dleacock's full-sized avatar
🍔

David Leacock dleacock

🍔
  • YoppWorks
  • Saskatoon, SK
View GitHub Profile
@dleacock
dleacock / gist:210b815f99900a37b0f8
Last active August 29, 2015 14:22
Swapping Elements
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
/// Recieves input in the form of 22 16 1 44 72 42 92 87 59 93 87 41 : 3-12, 0-1, 5-12
/// The numbers after the colon on instructions. i.e swap elements in places 3 and 12,then 0 and 1 and so on.
/// Program takes in file for instruction. Parses string into a number array and instructions