第二题

谁第二题写出来了发个代码参考一下呗
全部评论
这个头文件贼六
点赞 回复 分享
发布于 2018-12-01 17:19
#include<iostream> #include<cstdio> #include<algorithm> #include<functional> #include<cstring> #include<string> #include<cmath> #include<queue> #include<stack> #include<deque> #include<vector> #include<map> #include<list> #include<set> #include<cmath> typedef unsigned long long ULL; typedef long long LL; using namespace std; const int maxn = 100000 + 10; int a[maxn]; int max1 = -1; int main() {     int T;     while(cin >> T)     {         memset(a,0,sizeof(a));         for(int i = 1;i <= T;++i)             cin >> a[i];         int ans = 1;         max1 = a[1];         for(int i = 2;i <= T;++i)             if(a[i] >= max1)             {                 ans++;                 max1 = a[i];             }         cout << ans << endl;     }     return 0; } 头文件不用管
点赞 回复 分享
发布于 2018-12-01 17:03

相关推荐

代码飞升:别用口语,后端就写后端,前端就写前端,最后别光后悔
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务