1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#include <iostream>
#include <fstream>
using namespace std;
void skaityti(int A[], int B[], double C[], int D[], int E[], int & n);
int didv(double C[], int n);
const int Cmax = 100;
int main()
{
ifstream fd("duom.txt");
ofstream fr("rez.txt");
int men[Cmax],diena[Cmax],brvk[Cmax],raud[Cmax],n;
double mase[Cmax];
skaityti(men,diena,mase,brvk,raud,n);
didv(mase,n);
}
void skaityti(int A[], int B[], double C[], int D[], int E[], int & n)
{
ifstream fd("duom.txt");
fd >> n;
for (int i = 0; i < n; i++){
fd >> A[i] >> B[i] >> C[i] >> D[i] >> E[i];
}
fd.close();
}
int didv(double C[], int n)
{
double max = C[0];
int maxind = 0;
for (int i = 1; i < n; i++)
if (C[i] > max) {
max = C[i];
maxind = i;
}
return maxind;
}
|