Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int a,b,w,k;
- float e,c,d;
- int main()
- {
- cin >> w;
- cin >> k;
- c=0;
- d=0;
- int tab[w][k];
- for (int a=0; a<w; a++)
- {
- for (int b=0; b<k; b++)
- {
- tab[a][b]=1+rand()%(100);
- c=c+tab[a][b];
- d++;
- }
- }
- e=c/d;
- cout << "suma: " << c << ", ilosc: " << d << ", srednia: " << e;
- return 0;
- }
Add Comment
Please, Sign In to add comment