put all the allowable values per variable into a vector or list, then iterate over all of them. e.g:

(untested)


#include <iostream>
#include <vector>
using namespace std;

float...