ex81113.cpp

来源:互联网 发布:防范网络电信诈骗 编辑:程序博客网 时间:2024/06/06 03:44
 /**************************************************************************
PURPOSE: 打印8*8棋盘,每个方块5个字符宽,3个字符高
TIME: 08/10/25    21:17
AUTHOR:    ch8_daniel
INPUT:    
OUTPUT:
VERSION:    1.0
**************************************************************************/
 
#include <iostream>

using namespace std;

int main()
{
    for (int p=0; p<9; p++)
    {
        for (int m=0; m<49; m++)
        {
            if (m%6 == 0)
            {
                 cout << "+";
            }
            else  
            {
                cout << "-";
            }
        }    
        
        for (int cnt=0; cnt<3; cnt++)
        {
            cout << endl;
            
            if(p == 8)
            {
                return 0;
            }
                    
            for (int n=0; n<49; n++)
            {
                if (n%6 == 0)  
                {
                    cout << "|";
                }
                else
                {
                     cout << " ";
                }
            }
        }
        
        cout << endl;
    }
    
  return 0;
}
原创粉丝点击