Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Hallgato
- {
- int R; // összpontszám
- int Cs1; // 1. csoport zárthelyi
- int Cs2; // 2. csoport zárthelyi
- int Ef; // évfolyam zárthelyi
- int Gy; // gyakorlati jegy
- };
- int main()
- {
- // cout << "hallgatok szama: ";
- int n;
- cin >> n;
- Hallgato h[n];
- for(int i=0; i<n; ++i)
- {
- // cout << i+1 << ". hallgato osz: "; cin >> h[i].R;
- // cout << i+1 << ". hallgato 1. cs zh: ";cin >> h[i].Cs1;
- // cout << i+1 << ". hallgato 2. cs zh: "; cin >> h[i].Cs2;
- // cout << i+1 << ". hallgato e zh: "; cin >> h[i].Ef;
- cin >> h[i].R >> h[i].Cs1 >> h[i].Cs2 >> h[i].Ef;
- if(h[i].R<10)
- h[i].Gy = 1;
- else
- h[i].Gy = ((h[i].Cs1+h[i].Cs2+(2*h[i].Ef))/4+0,5);
- }
- // for(int i=0; i<n; ++i)
- // {
- // cout << h[i].R << " " << h[i].Cs1 << " " << h[i].Cs2 << " " << h[i].Ef << " " << h[i].Gy << endl;
- // }
- // elso feladat
- int c = 0;
- for(int i=0; i<n; ++i)
- if(h[i].R < 10)
- ++c;
- cout << c << endl;
- // masodik feladat
- int cc = 0;
- int temp[n];
- for(int i=0; i<n; ++i)
- if(h[i].R >= 10 && (h[i].Cs1 == 0 || h[i].Cs2 == 0))
- {
- temp[cc] = i+1;
- ++cc;
- }
- cout << cc << " ";
- for(int i=0; i<cc; ++i)
- cout << temp[i] << " ";
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment