Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int main()
- {
- int x = 10, y = 10;
- int **ptr = new int *[x];
- int summa;
- for(int i = 0; i<y; i++)
- {
- ptr[i] = new int[y];
- }
- srand(time(0));
- for(int j = 0; j<x; j++)
- {
- for(int k = 0; k<y; k++)
- {
- int a = rand()%99;
- summa = summa +a;
- ptr[j][k] = a;
- cout<< ptr [j][k]<<" " ;
- }
- cout << " | " << summa << endl;
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement