码迷,mamicode.com
首页 > 其他好文 > 详细

CCF_201612-1_最大波动

时间:2016-11-12 07:36:45      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:str   ace   blog   scanf   scan   for   space   amp   print   

http://115.28.138.223/view.page?gpid=T47

 

水。

 

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

int a[1005];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i = 1;i <= n;i++)   scanf("%d",&a[i]);
    int maxx = 0;
    for(int i = 2;i <= n;i++)   maxx = max(maxx,abs(a[i]-a[i-1]));
    printf("%d\n",maxx);
    return 0;
}

 

CCF_201612-1_最大波动

标签:str   ace   blog   scanf   scan   for   space   amp   print   

原文地址:http://www.cnblogs.com/zhurb/p/6056104.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!