#include using namespace std; string filename(const string &type) { static int serial = 1; ostringstream oss; oss << setw(3) << setfill('0') << serial << "-" << type << ".in"; serial++; return oss.str(); } void gen_case(const string &curr, const string &dest) { ofstream out(filename(curr + "-" + dest)); out << curr << endl; out << dest << endl; } int main() { const string heading[] = { "N", "W", "E", "S", "NW", "NE", "SW", "SE" }; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { gen_case(heading[i], heading[j]); } } return 0; }