#include #include #include #define MAXN 5000 using namespace std; int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } int main() { int i = 0; long long n; long long prom; long long arr[MAXN]; ifstream file; file.open("pooh.in"); file >> n; while(!file.eof()) { file >> prom; arr[i] = prom; i++; //cout << prom<<" "; } file.close(); //cout << n; //getch(); qsort (arr, n, sizeof(int), compare); // for(int i =0; i maxSum) { maxN = tempN; } ofstream file2; file2.open("pooh.out"); file2 << maxN << endl; file2.close(); return 0; }