#include
int main(){const int kol_tov = 20;
int sbol = 0;int sbol_index = 0;int smal = 0;int smal_index = 0;
int massiv[kol_tov] = { 12, 150, 1230, 332, 531, 1321, 32313, 123123, 123434, 4844, 84847, 48816, 181684, 181, 78616, 81141, 1894, 18974, 91234, 21239 };
smal = massiv[1];
for (int i = 0; i < kol_tov; i++){ if (massiv[i] > sbol) { sbol = massiv[i]; sbol_index = i + 1; } if (massiv[i] < smal) { smal = massiv[i]; smal_index = i + 1; }}
std::cout << "Samoe dorogoe: " << sbol << std::endl << "Samoe deshevoe: " << smal << std::endl << "Index dorogogo: " << sbol_index << std::endl << "Index deshevogo: " << smal_index << std::endl; system("PAUSE");}