Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void wypelnienie();
- void wypisanie();
- void srednia();
- void wieksza();
- int m = 1;
- struct Avg
- {
- int x, w;
- };
- Avg T[6];
- int main()
- {
- wypelnienie();
- wypisanie();
- srednia();
- }
- void wypelnienie()
- {
- cout << "Uzupelnij ocene: \n";
- for(int i = 0; i < 6; i++)
- {
- cin >> T[i].x;
- }
- cout << "Uzupelnij wage :\n";
- for(int i = 0; i < 6; i++)
- {
- cin >> T[i].w;
- }
- }
- void wypisanie()
- {
- cout << "Oceny: ";
- for(int i = 0; i < 6; i++) cout << T[i].x << ", ";
- }
- void srednia()
- {
- cout << "Srednia: ";
- for(int i = 0; i < 6; i++) m=(T[i].x*T[i].w)/T[i].w;
- cout << m;
- }
- void wieksza()
- {
- for(int i = 0; i < 6; i++)
- {
- if(T[i].x > m) cout << T[i].x << ", ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement