Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int presmetki(int mat[g][h])// Funkcijata se deklarira so niza mat kako argument
- {
- int kol=0,niz=0,zbir=0;
- int p=h , l=g;
- int koln[l],nizn[p];
- int brojac1=0;
- int brojac2=0;
- for (int y=0;y<b;y++)
- {
- for(int u=0;u<a;u++)
- {
- kol=kol+mat[y,u];
- }
- koln[brojac1]=kol;
- kol=0;
- brojac1++;
- }
- for (int q=0;q<a;q++)
- {
- for (int w=0;w<a;w++)
- {
- niz=niz+mat[q,w];
- }
- nizn[brojac2]=niz;
- niz=0;
- brojac2++;
- }
- for (int e=0;e<a;e++)
- {
- for (int r=0;r<b;r++)
- {
- zbir=zbir+mat[e,r];
- }
- }
- return zbir, nizn[p],koln[l];
- }
- }
- int main()
- {
- int k,j
- cin>>k>>j;
- int niza[k,j];
- for(inta=0;a<k;a++)
- {
- for(int b=0;b<j;j++)
- {
- cin>>niza[a][b];
- }
- }
- int presmetki(int niza[a][b])
- cout<<"Zbirovite na nizite se";
- for(x=0;x<b;x++)
- {
- cout<<nizi[x]" ";
- }
- cout<<endl;
- cout<<"Zbirovite na kolonite se";
- for (int c=0;c<a;c++)
- {
- cout<<koln[b]" ";
- }
- cout<<endl;
- cout<<"Zbirot na site elementi na matricate e: "<<zbir;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement