⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitmapdemo.cpp

📁 C++&datastructure书籍源码,以前外教提供现在与大家共享
💻 CPP
字号:
#include <iostream>
using namespace std;
#include "charbitmap.h"
#include "prompt.h"
#include "randgen.h"

int main()
{
    int rows, cols;
    cout << "enter row col size ";
    cin >> rows >> cols;
    CharBitMap bmap(rows,cols);
    int pixelCount = PromptRange("# pixels on ",1,rows*cols);
    int k;
    RandGen gen;
    for(k=0; k < pixelCount; k++)
    {    bmap.SetPixel(gen.RandInt(0,rows-1),gen.RandInt(0,cols-1),CharBitMap::black);
    } 
    bmap.Display(cout);
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -