#include void sort(int N) { char end = 'a' + N - 2; while (end >= 'a') { char first = 'a'; while (first <= end) { char second = first + 1; cout << " swapif(" << first << ", " << second << ");"; first = first + 1; } cout << "\n"; end = end - 1; } } void initialise(int N) { char var = 'a', last = 'a' + N - 1; while (var <= last) { cout << " int " << var << " = random_in_range(1, 99);\n"; var = var + 1; } } void printall(int N) { char var = 'a', last = 'a' + N - 1; cout << " cout"; while (var <= last) { cout << " << " << var << " << \" \""; var = var + 1; } cout << " << \"\\n\";\n"; } void main() { cout << "how many variables to sort? "; int number; cin >> number; cout << "#include \n"; cout << "\n"; cout << "void swapif(int & x, int & y)\n"; cout << "{ if (x > y)\n"; cout << " { int temp = x;\n"; cout << " x = y;\n"; cout << " y = temp; } }\n"; cout << "\n"; cout << "void main()\n"; cout << "{\n"; initialise(number); printall(number); sort(number); printall(number); cout << "}\n"; }