Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int a[10][10], n, m, b[100][100];
- void citire();
- int main()
- {
- citire();
- for(int i=1; i<=n; i++)
- {
- for(int j=1; j<=m; j++)
- cout<<b[i][j]<<" ";
- cout<<'\n';
- }
- return 0;
- }
- void citire()
- {
- ifstream f("c.in");
- f>>n;
- for(int i=1; i<=n; i++)
- for(int j=1; j<=n; j++)
- {
- f>>a[i][j];
- if(a[i][j] == 1)
- {
- m++;
- b[i][m] = 1;
- b[j][m] = -1;
- }
- }
- f.close();
- }
- /* c.in */
- 6
- 0 1 1 0 0 0
- 0 0 1 0 0 1
- 0 0 0 0 0 0
- 0 0 1 0 1 0
- 0 0 0 0 0 0
- 1 0 0 1 1 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement