返回列表 發帖
  1. #include<string>
  2. #include<utility>
  3. #include<iostream>
  4. using namespace std;
  5. int main()
  6. {
  7.     int x;
  8.     while(cin>>x)
  9.     {
  10.         if(x==0)
  11.             break;
  12.         pair<string,string> token(string(x,'#'),string(x,'.'));
  13.         for(int i=0;i<8;i++)
  14.         {
  15.             for(int k=0;k<x;k++)
  16.             {
  17.                 for(int j=0;j<4;j++)
  18.             {

  19.                 if(!(i%2))
  20.                     cout<<token.first<<token.second;
  21.                 else
  22.                     cout<<token.second<<token.first;
  23.             }
  24.             cout<<"\n";
  25.             }
  26.         }
  27.     }
  28.     return 0;
  29. }
複製代碼

TOP

返回列表