Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- void wypelnij(float tab[4][5])
- {
- for (int i=0; i<4; i++)
- {
- for (int j=0; j<5; j++)
- {
- cout << "Numer ucznia: " << i+1 << endl << " Numer oceny: " << j+1 <<": ";
- cin >> tab[i][j];
- }
- }
- }
- void sred(float tab[4][5])
- { int sred,numer,sredpop;
- for (int i=0;i<4;i++)
- {
- for (int j=0;j<5;j++)
- {
- sred=sred+tab[i][j];
- }
- if(sred>=sredpop)
- {
- sredpop=sred;
- numer=i;
- }
- }
- cout << "Uczen nr: " << numer+1 << " ma najwyzsza srednia: " << sredpop/5 << endl;
- }
- int main()
- {
- float tab[4][5];
- wypelnij(tab);
- sred(tab);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement