-
Notifications
You must be signed in to change notification settings - Fork 1
/
Burse Studentesti.cpp
64 lines (41 loc) · 1.37 KB
/
Burse Studentesti.cpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int main(){
string nume_student,prenume_student,NUME,PRENUME;
int m,n,p;
int qwe=0,nr_treceri=0;
float suma=0,q=0,max=0;
float medie_student=0,note;
cin>>m>>n>>p;
for(int i=0;i<m;i++){
cin>>nume_student>>prenume_student;
//cout<<nume_student<<prenume_student;
for(int j=0;j<n;j++){
cin>>note;
suma=note+suma;
medie_student=suma/n;
if(note>=5){
qwe++;
if(qwe==n&&medie_student>=8){
nr_treceri++;
}
}
//cout<<note;
}
qwe=0;
if(max<medie_student){max=medie_student;
NUME=nume_student;
PRENUME=prenume_student;
}
medie_student=0;
suma=0;
}
if(nr_treceri-1>p){
cout<<p<<endl<<NUME<<" "<<PRENUME<<" "<<fixed<<setprecision(2)<<max;}else{ cout<<nr_treceri-1<<endl<<NUME<<" "<<PRENUME<<" "<<fixed<<setprecision(2)<<max;}
//cout<<p<<" "<<nr_treceri;
}