#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { srand (time(NULL)); int pole[8][8] = {0}; pole[1][2] = 1; pole[2][2] = 1; pole[3][2] = 1; pole[4][2] = 1; pole[4][3] = 1; pole[4][4] = 1; pole[3][4] = 1; pole[5][4] = 1; pole[4][5] = 1; pole[6][4] = 1; for (int nRow=0; nRow < 8; nRow++) { for (int nCol = 0; nCol < 8; nCol++) cout << pole[nRow][nCol] << " "; cout << endl; } double activation = 0; for (int i=0; i<64; i++) { double x[i],w[i]; activation += x[i] * w[i]; } system("PAUSE"); return EXIT_SUCCESS; } |
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { srand (time(NULL)); int pole[8][8] = {0}; pole[1][2] = 1; pole[2][2] = 1; pole[3][2] = 1; pole[4][2] = 1; pole[4][3] = 1; pole[4][4] = 1; pole[3][4] = 1; pole[5][4] = 1; pole[4][5] = 1; pole[6][4] = 1; for (int nRow=0; nRow < 8; nRow++) { for (int nCol = 0; nCol < 8; nCol++) cout << pole[nRow][nCol] << " "; cout << endl; } double activation = 0; for (int i=0; i<64; i++) { double x[i],w[i]; for (int nRow=0; nRow < 8; nRow++) { for (int nCol = 0; nCol < 8; nCol++) x[i] = pole[nRow][nCol]; } activation += x[i] * w[i]; } system("PAUSE"); return EXIT_SUCCESS; } |
|
|
|
|