Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <vector>
- using namespace std;
- int main()
- {
- int n, m;
- scanf("%d%d", &n, &m);
- vector<int> column(m, 0);
- for(int i = 0; i < n; i++)
- {
- for(int j = 0; j < m; j++)
- {
- char c;
- cin >> c;
- if (c == '*')
- ++column[j];
- }
- }
- int imin = 0;
- for(int j = 1; j < m; j++)
- {
- if (column[j] < column[imin])
- imin = j;
- }
- int difference = column[imin];
- for(int j = 0; j < m; j++)
- column[j] = n + difference - column[j];
- for(int i = 0; i < n; i++, cout << endl)
- for(int j = 0; j < m; j++)
- if (column[j] <= i)
- cout << "*";
- else
- cout << ".";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement