(x) x (y)のかけざんをかんがえて遊ぶ(プラマイ二乗法)


x かころぐみよ
x arduini uno よていは、みてい
x 特に符号(　プラス　マイナス　)の処理は、考えていない
x 非営利、学術調査研究の為に引用しました。

https://piclabo.blog.ss-blog.jp/Z80Multiplication


![o_coq227.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/f4d37ee3-0083-eaf7-c61a-8bbe17182d4c.jpeg)

結果

![o_coq226.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/90b5a510-8a5a-896f-17fc-68ecca8493f5.jpeg)


プログラム


```c++



int ni_no_nijyou[] = {
0, //0 
1, //1 
4, //2 
9, //3 
16, //4 
25, //5 
36, //6 
49, //7 
64, //8 
81, //9 
100, //10 
121, //11 
144, //12 
169, //13 
196, //14 
225, //15 
256, //16 
289, //17 
324, //18 
361, //19 
400, //20 
441, //21 
484, //22 
529, //23 
576, //24 
625, //25 
676, //26 
729, //27 
784, //28 
841, //29 
900, //30 
961, //31 
1024, //32 
1089, //33 
1156, //34 
1225, //35 
1296, //36 
1369, //37 
1444, //38 
1521, //39 
1600, //40 
1681, //41 
1764, //42 
1849, //43 
1936, //44 
2025, //45 
2116, //46 
2209, //47 
2304, //48 
2401, //49 
2500, //50 
2601, //51 
2704, //52 
2809, //53 
2916, //54 
3025, //55 
3136, //56 
3249, //57 
3364, //58 
3481, //59 
3600, //60 
3721, //61 
3844, //62 
3969, //63 
4096, //64 
4225, //65 
4356, //66 
4489, //67 
4624, //68 
4761, //69 
4900, //70 
5041, //71 
5184, //72 
5329, //73 
5476, //74 
5625, //75 
5776, //76 
5929, //77 
6084, //78 
6241, //79 
6400, //80 
6561, //81 
6724, //82 
6889, //83 
7056, //84 
7225, //85 
7396, //86 
7569, //87 
7744, //88 
7921, //89 
8100, //90 
8281, //91 
8464, //92 
8649, //93 
8836, //94 
9025, //95 
9216, //96 
9409, //97 
9604, //98 
9801, //99 
10000, //100 
10201, //101 
10404, //102 
10609, //103 
10816, //104 
11025, //105 
11236, //106 
11449, //107 
11664, //108 
11881, //109 
12100, //110 
12321, //111 
12544, //112 
12769, //113 
12996, //114 
13225, //115 
13456, //116 
13689, //117 
13924, //118 
14161, //119 
14400, //120 
14641, //121 
14884, //122 
15129, //123 
15376, //124 
15625, //125 
15876, //126 
16129, //127 
16384, //128 
16641, //129 
16900, //130 
17161, //131 
17424, //132 
17689, //133 
17956, //134 
18225, //135 
18496, //136 
18769, //137 
19044, //138 
19321, //139 
19600, //140 
19881, //141 
20164, //142 
20449, //143 
20736, //144 
21025, //145 
21316, //146 
21609, //147 
21904, //148 
22201, //149 
22500, //150 
22801, //151 
23104, //152 
23409, //153 
23716, //154 
24025, //155 
24336, //156 
24649, //157 
24964, //158 
25281, //159 
25600, //160 
25921, //161 
26244, //162 
26569, //163 
26896, //164 
27225, //165 
27556, //166 
27889, //167 
28224, //168 
28561, //169 
28900, //170 
29241, //171 
29584, //172 
29929, //173 
30276, //174 
30625, //175 
30976, //176 
31329, //177 
31684, //178 
32041, //179 
32400, //180 
32761, //181 
33124, //182 
33489, //183 
33856, //184 
34225, //185 
34596, //186 
34969, //187 
35344, //188 
35721, //189 
36100, //190 
36481, //191 
36864, //192 
37249, //193 
37636, //194 
38025, //195 
38416, //196 
38809, //197 
39204, //198 
39601, //199 
40000, //200 
40401, //201 
40804, //202 
41209, //203 
41616, //204 
42025, //205 
42436, //206 
42849, //207 
43264, //208 
43681, //209 
44100, //210 
44521, //211 
44944, //212 
45369, //213 
45796, //214 
46225, //215 
46656, //216 
47089, //217 
47524, //218 
47961, //219 
48400, //220 
48841, //221 
49284, //222 
49729, //223 
50176, //224 
50625, //225 
51076, //226 
51529, //227 
51984, //228 
52441, //229 
52900, //230 
53361, //231 
53824, //232 
54289, //233 
54756, //234 
55225, //235 
55696, //236 
56169, //237 
56644, //238 
57121, //239 
57600, //240 
58081, //241 
58564, //242 
59049, //243 
59536, //244 
60025, //245 
60516, //246 
61009, //247 
61504, //248 
62001, //249 
62500, //250 
63001, //251 
63504, //252 
64009, //253 
64516, //254 
65025, //255 
65536 //256 
};



#include <iostream>
using namespace std;
int main(void){
    // Your code here!

    printf("\n\nSTART\n\n");
    
    
    // ((x+y)^2 - (x-y)^2) / 4  
    
    int x=2;
    int y=3;
    int a;
    
    a = ni_no_nijyou[x+y] - ni_no_nijyou[x-y];
    a = a >> 2;
    
    printf("%d x %d = %d\n",x,y,a);
    
}





```