Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int Random (int a,int b)
- {
- return a+rand()%(b-a-1);
- }
- int main()
- {
- srand(time(0));
- int arr[5][3],bar[3];
- for(int i=0;i<5;i++)
- {
- for(int j=0;j<3;j++)
- {
- arr[i][j]=Random(0,10);
- cout<<"|"<<arr[i][j]<<"|";
- }
- cout<<endl;
- }
- for(int i=0;i<5;i++)
- {
- bar[i]=1;
- for(int j=0;j<3;j++)
- {
- bar[i]*=arr[i][j];
- }
- }
- for (int i=0;i<5;i++)
- {
- cout<<"|"<<bar[i]<<"|";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement