-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (32 loc) · 864 Bytes
/
main.cpp
File metadata and controls
48 lines (32 loc) · 864 Bytes
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
40
41
42
43
44
45
46
47
48
#include <iostream>
#include "enor.h"
#include <math.h>
#include <cstdlib>
using namespace std;
int main()
{
Enor t("in.txt");
/* for(t.First(); !t.end(); t.Next()) {
Bekezdes e = t.Current();
cout << "Sorszam: " << e.sorszam << endl;
cout << "Sorok: " << e.sor_db << endl;
cout << "Szavak: " << e.szo_db << endl;
}*/
Eredmeny x;
x.hanyados = 0;
x.sorszam = 0;
bool l = false;
for(t.First(); !t.end(); t.Next()) {
Bekezdes e = t.Current();
float tmp = (float)e.szo_db/ (float)e.sor_db;
if(e.sor_db < 3);
else{cout << tmp << endl;
if(tmp > x.hanyados) {
x.hanyados = tmp;
x.sorszam = e.sorszam;
}
}
}
cout << x.sorszam << ":\t" << x.hanyados << endl;
return 0;
}