Skip to content

Instantly share code, notes, and snippets.

@oskimura
Created December 14, 2017 07:39
Show Gist options
  • Save oskimura/3f9809f91ac85244d00dff7031c7d1f3 to your computer and use it in GitHub Desktop.
Save oskimura/3f9809f91ac85244d00dff7031c7d1f3 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cmath>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
int main()
{
int w,h;
while (std::cin >> h >> w) {
bool flag = false;
if (w==0) {
continue;
}
for (int y=0;y<h;y++) {
if (y%2==1) {
flag=true;
}
else {
flag=false;
}
for (int x=0;x<w;x++) {
if (!flag) {
std::cout << "#";
}
else {
std::cout << ".";
}
flag = (flag)?false:true;
}
std::cout << std::endl;
}
std::cout << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment