#include #include #include using namespace std; struct e_grid{ int high; int low; }; #define RESULT 0 #define LATIN_R 1 #define LATIN_L 2 #define MAX 226 int result[MAX][MAX]; // 結果を格納 int generator(int size, int kind) { // 直交するラテン方陣の生成 int latin_r[MAX][MAX]; int latin_l[MAX][MAX]; for(int y=0; y> size; if((3<=size<=MAX)&&(size%2)); else{ cout << "\nillegal..."; return -1; } cout << "\nkind of result?\n0.normal / 1.latin_r / 2.latin_l\n-"; cin >> kind; if(!(0<=kind<=2)){ cout << "\nillegal..."; return -1; } cout << "start\n"; // generatorを呼び出す generator(size, kind); cout << "generated\n"; // ファイルへ出力 ofstream fout; fout.open("MagicSquare.csv", ios::out); if(!fout) return -1; char buff[15]; for(int y=0; y