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

基础训练 数列特征

时间:2019-01-24 21:59:33      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:数列   str   for   ble   ace   code   lan   ios   math.h   

数列特征

#include<iostream>
#include<math.h>
using namespace std;
int main(){
    int n, sum=0, maxn=-999999, minn=999999, t;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>t;
        maxn=max(maxn, t);
        minn=min(minn, t);
        sum+=t;
    }
    cout<<maxn<<endl<<minn<<endl<<sum<<endl;
    return 0;
}

基础训练 数列特征

标签:数列   str   for   ble   ace   code   lan   ios   math.h   

原文地址:https://www.cnblogs.com/A-Little-Nut/p/10316839.html

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