网站域名跳转代码,wordpress顶部图像取消不,网站营销活动策划,十大不收费看盘软件排名下载这是Titan Ruins系列第一道题#xff0c;以后慢慢更新。 赤裸裸滴阅读理解题#xff0c;大意就是找到三个连在一起的数#xff0c;使其之和最大#xff0c;输出的第一个数是这三个数的和#xff0c;第二个数是中间那个数所在的位置。水题一道#xff0c;很简单。 1 #incl…这是Titan Ruins系列第一道题以后慢慢更新。 赤裸裸滴阅读理解题大意就是找到三个连在一起的数使其之和最大输出的第一个数是这三个数的和第二个数是中间那个数所在的位置。水题一道很简单。 1 #include iostream2 #include vector3 using namespace std;4 int main()5 {6 int n;7 cin n;8 int *a new int[n1];9 for (int i 1; i n; i)
10 cin a[i];
11 int max 0;
12 int index 0;
13 for (int i 1; i n-2; i)
14 {
15 int sum a[i] a[i1] a[i2];
16 {
17 if (sum max)
18 {
19 max sum;
20 index i1;
21 }
22 }
23 }
24 cout max index endl;
25 return 0;
26 } 转载于:https://www.cnblogs.com/PegasusWang/archive/2013/04/20/3032829.html