//蛇形填数2
/*
1 2 6 7 15 16 ……
3 5 8 14 17 ……
4 9 13 18 ……
10 12 19 ……
11 20 ……
21 ……
……
*/
/*
1
1 + 1 * 4 = 5
5 + 2 * 4 = 13
13 + 3 * 4 = 25
……
*/
//求第20行20列的值
#include <bits/stdc++.h>
using namespace std;
int main(){
int n = 20;
int s = 1;
for(int i = 0; i < n; i++){
s += i * 4;
}
cout << s << endl;
return 0;
}
0 回复
0 转发
0 喜欢
0 阅读



