[백준] 10709 기상캐스터

0

백준

목록 보기
241/271
post-thumbnail
post-custom-banner

[백준] 10709 기상캐스터

#include <iostream>
#include <string>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; ++i) {
		string sky;
		cin >> sky;

		int time = -1;
		for (int j = 0; j < W; ++j) {
			if (sky[j] == 'c') 
				time = 0;
			else if (time != -1) time++;

			cout << time << " ";
		}
		cout << "\n";
	}

	return 0;
}

profile
Be able to be vulnerable, in search of truth
post-custom-banner

0개의 댓글