#include <iostream>
template<typename T>
void enum_top(T data[], int n, int top_count)
{
int entry_count = 0;
for(int i = 0; entry_count < top_count; ++i)
{
int lose_count = 0;
for(int c = 0; c < n; ++c)
{
lose_count += data[i] < data[c];
if(lose_count >= top_count) goto next;
}
entry_count++;
std::cout << data[i] << std::endl;
next:;
}
}
template<typename T>
void enum_top(T data[], int n, float percentage)
{
int top_count = int(n * percentage / 100.f);
enum_top(data, n, top_count);
}
코드 봐도 무슨 문젠지 모르는 사람이 태반이겠군.
http://autogram.tk/이
중고차 어플리케이션 어떤가요?