ZOJ 3880 Demacia of the Ancients

題意:給出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 ([email protected])
*# @Date    : 2015-04-26 18:22:16
*# @Link    : http://blog.csdn.net/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;
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章