massiv

If I generate a massive with what function I can find third biigest????

start of algo

int main()
{
int skaits, rnd;
cout << "cik random skaitlus generet?" << endl;
cin >> skaits;
int arr[skaits];
cout << "\nuzgeneretie random skaitli ir:" << endl;
srand((unsigned)time(0));
int mazakais=1, lielakais=100;
int range=(lielakais-mazakais)+1;
for(int i=0; i<skaits; i++){
rnd = mazakais+int(range*rand()/(RAND_MAX + 1.0));
arr[i]=rnd;
cout << arr[i] << endl;
}


return 0;
}
Topic archived. No new replies allowed.