Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<vector>
- typedef std::vector<std::vector<int>> Matrica;
- bool funkcija(Matrica m)
- {
- bool trougaona=false;
- for (int i(0); i<m.size(); i++)
- {
- for (int j(0); j<m[0].size(); j++)
- {
- if(i>0 && j<i)
- {
- if(m[i][j] == 0)
- trougaona = true;
- }
- }
- }
- return trougaona;
- }
- int main()
- {
- int m, n;
- std::cout<<"Unesi dimenziju matrice:\n";
- std::cin>>m>>n;
- Matrica mat(m, std::vector<int>(n));
- std::cout<<"Unesi clanove matrice:\n";
- for (int i(0); i<m; i++)
- {
- for(int j(0); j<n; j++)
- {
- std::cin>>mat[i][j];
- }
- }
- bool rez = funkcija(mat);
- std::cout<<"\n rezultat: "<< rez;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment