#include #include using namespace std; int main() { int a[] = {5,18,7,9,2,1,11,8,2,3}; int i,k,b,c,max1,max2,max3,n; n = sizeof(a)/sizeof(a[0]); max1 = a[0]; k = 0; for(i=1; i max1) { max1 = a[i]; k = i; } } cout << "Najwiekszy element: " << max1 << endl; cout << "Indeks: " << k << endl << endl; if(k == 0) max2 = a[1]; else max2 = a[0]; b = 0; for(i=1; i max2) { max2 = a[i]; b = i; } } if(b == 0) max3 = a[2]; else max3 = a[0]; c = 0; for(i=1; i max3) { max3 = a[i]; c = i; } } cout << "Drugi najwiekszy element: " << max2 << endl; cout << "Indeks: " << b << endl; cout << endl; cout << "Trzeci najwiekszy element: " << max3 << endl; cout << "Indeks: " << c << endl; system("pause"); return 0; }