Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <time.h>
- using namespace std;
- int main()
- {
- int a[10][10]; int n, s=0, p=1;
- cout<<"\nRazmer: ";
- cin>>n;
- srand(time(0));
- for (int i = 0; i<n; i++){
- for (int j = 0; j<n; j++){
- a[i][j]=rand()%100;
- cout<<a[i][j]<<" ";
- }
- cout<<"\n ";
- }
- for (int i=0; i<n;i++){
- for (int j = 0; j<n; j++){
- if(i>j){
- s+=a[i][j];
- }
- if (i<j){
- p*=a[i][j];
- }
- }
- }
- cout<<"\n sum = "<<s<<"\n p = "<<p;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement