Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int n;
- void f(int v[11])
- {int nr=0;
- for(int i=n;i>=1;i--)
- {
- if(v[i]==1)
- {
- nr+=pow(2,n-i);
- }
- }
- cout<<nr<<" ";
- }
- int main()
- {
- int a[11][11];
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- for(int j=1;j<=n;j++)
- {
- cin>>a[i][j];
- }
- f(a[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement