题意:给出n个数,求出严格大于6000数的个数
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5528
思路:模拟
注意点:无
以下为AC代码:
| Run ID | Submit Time | Judge Status | Problem ID | Language | Run Time(ms) | Run Memory(KB) | User Name |
| 3944961 | 2015-04-26 18:23:49 | Accepted | 3880 | C++0x | 70 | 264 | luminus |
/*
***********************************************
*# @Author : Luminous11 (573728051@qq.com)
*# @Date : 2015-04-26 18:22:16
*# @Link : http://blog.youkuaiyun.com/luminous11
***********************************************
*/
#include <bits/stdc++.h>
#define clr(a, v) memset( a , v , sizeof(a) )
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1.0);
int main()
{
ios::sync_with_stdio ( false );
int T;
cin >> T;
while ( T -- ){
int n;
cin >> n;
int cnt = 0;
while ( n -- ){
int tmp;
cin >> tmp;
if ( tmp > 6000 )cnt ++;
}
cout << cnt << endl;
}
return 0;
}

本文介绍如何解决ZJU在线编程平台上的问题,该问题要求统计一组整数中大于6000的数的个数。通过简单的模拟方法,实现高效的代码解决方案。
1185

被折叠的 条评论
为什么被折叠?



