Untitled

 avatar
unknown
plain_text
2 years ago
427 B
4
Indexable
#include <iostream>
using namespace std;
int main()
{
	int n;
	int m;
	cin >> n >> m;
	char mas[50][50];
	for (int i = 0; i < n; i++){
		for (int w = 0; w < m; w++){
			if (((i + 1) * m + w + 1) % 2 == 0){
				mas[i][w] = '*';
			}
			else{
				mas[i][w] = '.';
			}
		}
	}
	for (int i = 0; i < n; i++) {
		for (int w = 0; w < m; w++){
			cout << mas[i][w] << " ";
		}
		cout << endl;
	}
	return 0;
}
Editor is loading...
Leave a Comment