int main() { int input; printf("Input Lenght Of the multidimentional array");scanf("%d",&input); int multidimentionalArray[input][input]; int arrayCounter = 0; for(arrayCounter = 0; arrayCounter < input; arrayCounter++) { int secondCounter = 0; for(secondCounter = 0; secondCounter < input; secondCounter++) { printf("Input Digits -->"); scanf("%d",&multidimentionalArray[arrayCounter][secondCounter]); printf("\n"); } } if(MagicCube(input,multidimentionalArray)) { printf("The Cube Is Magical\n"); } else { printf("The Cube is Not Magical\n"); } }
bool MagicCubeTree::findMagicCube(){ std::ifstream inFile; std::string history = "", compress = ""; MagicCube cube; bool found = false; inFile.open(fileName); if (inFile.is_open()) { getline(inFile, history); while (!found && history != "") { getline(inFile, compress); cube = MagicCube(history, compress); if ((VirtualMagicCube &)cube == (VirtualMagicCube &)this->myself) { found = true; } getline(inFile, history); } inFile.close(); } else { std::cout << "[findMagicCube()]The file is not open!" << std::endl; getchar(); } return found; }