fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, d, y=0;
  6. cin >> n >> d;
  7. char ara[n][d];
  8.  
  9. for(int i=0; i<n; i++){
  10. for(int j=0; j<d; j++){
  11. cin >> ara[i][j];
  12. }
  13. }
  14.  
  15. for(int j=0; j<d; j++){
  16. int x=0;
  17. for(int i=0; i<n; i++){
  18. if(ara[i][j] == 'o')
  19. x++;
  20. }
  21. if(x == n)
  22. y++;
  23. }
  24.  
  25. cout << y;
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5288KB
stdin
1 7
ooooooo
stdout
7