Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int tablica[3][4];
- int main(){
- srand(time(NULL));
- float a = 0;
- int amount = 0;
- for (int i = 0; i < 3; i++){
- for (int j = 0; j < 3; j++) tablica[i][j] = rand()%100+1;
- }
- for (int i = 0; i < 3; i++){
- for (int j = 0; j < 4; j++){
- a += tablica[i][j];
- amount++;
- }
- }
- cout << "suma elementow: " <<a<<" liczba elementow: " <<amount<<" srednia elementow: " << a/12<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment