Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void oceny(float tab[4][5])
- {
- for (int i=0; i<4; i++)
- {
- for (int j=0; j<5; j++)
- {
- cout << "Ocena " << i+1 << " ucznia " << j+1 <<endl;;
- cin >> tab[i][j];
- }
- }
- }
- void srednia(float tab[4][5])
- {
- float a=0;
- float b=0;
- float u;
- for (int i=0; i<4; i++)
- {
- a = 0;
- for (int j=0; j<5; j++)
- {
- a=a+tab[i][j];
- }
- if(a>=b)
- {
- b=a;
- u=i;
- }
- }
- cout << endl;
- cout << "Najwieksza srednia ma uczen " << u+1 << " i wynosi ona " << b/5;
- }
- int main()
- {
- float tab[4][5];
- oceny(tab);
- srednia(tab);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement