Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- int tab1[4][5];
- float tab2[4];
- float naj;
- for(int i=0;i<4;i++)
- {
- float s=0;
- for(int j=0;j<5;j++)
- {
- cin >> tab1[i][j];
- s=s+tab1[i][j];
- }
- s=s/5;
- tab2[i]=s;
- cout << "srednia wynosi: " << tab2[i] << endl;
- }
- naj=tab2[0];
- int ucz=1;
- for(int i=0;i<4;i++)
- {
- if(naj<tab2[i])
- {
- naj=tab2[i];
- ucz=ucz+1;
- }
- }
- cout << "Uczen " << ucz << " Posiada najwieksza srednia, ktora wynosi: " << naj;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment