Weather Forecaster (AOJ 0610) by ynu_b
Contest: 3408    RunID: 2260503    Status: Accepted    Date: Sun Apr 16 15:54:41 JST 2017


/// write by natto-
//#include<stdio.h>

#include<iostream>

using namespace std;

int main(){
    //scanf("%d",&n);
    int h,w;
    cin>>h>>w;
    char cloud[h][w];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>cloud[i][j];
        }
    }
    for(int i = 0; i < h; i++){
        int j=0;
            while(cloud[i][j] != 'c'&&j<w){
                cout << -1;
                j++;
                                if(j<w){
                    cout<<" ";
                }
            }
            int count = 0;
            while(j<w){
                if(cloud[i][j] == 'c'){
                    //int count = 0;
                    count=0;
                    cout<<count;
                }
                else{
                    count++;
                    cout<<count;
                }
                j++;
                if(j<w){
                    cout<<" ";
                }
            }
            cout << endl;
    }
    //input finish
    return 0;
}